diff layer/NoteLayer.cpp @ 1422:6f51297a0250

Keep the point being edited highlighted while the edit dialog is open
author Chris Cannam
date Tue, 05 Mar 2019 10:02:48 +0000
parents c8a6fd3f9dff
children 62e908518c71
line wrap: on
line diff
--- a/layer/NoteLayer.cpp	Mon Feb 18 14:33:35 2019 +0000
+++ b/layer/NoteLayer.cpp	Tue Mar 05 10:02:48 2019 +0000
@@ -57,6 +57,7 @@
     m_originalPoint(0, 0.0, 0, 1.f, tr("New Point")),
     m_editingPoint(0, 0.0, 0, 1.f, tr("New Point")),
     m_editingCommand(nullptr),
+    m_editIsOpen(false),
     m_verticalScale(AutoAlignScale),
     m_scaleMinimum(0),
     m_scaleMaximum(0)
@@ -777,6 +778,9 @@
     if (v->shouldIlluminateLocalFeatures(this, localPos)) {
         shouldIlluminate = getPointToDrag(v, localPos.x(), localPos.y(),
                                           illuminatePoint);
+    } else if (m_editIsOpen) {
+        shouldIlluminate = true;
+        illuminatePoint = m_editingPoint;
     }
 
     paint.save();
@@ -1092,6 +1096,9 @@
     dialog->setFrameDuration(note.duration);
     dialog->setText(note.label);
 
+    m_editingPoint = note;
+    m_editIsOpen = true;
+    
     if (dialog->exec() == QDialog::Accepted) {
 
         NoteModel::Point newNote = note;
@@ -1107,6 +1114,9 @@
         finish(command);
     }
 
+    m_editingPoint = 0;
+    m_editIsOpen = false;
+        
     delete dialog;
     return true;
 }