Mercurial > hg > svgui
changeset 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 | 70e93f996da6 |
children | 62e908518c71 aa0616116537 |
files | layer/NoteLayer.cpp layer/NoteLayer.h |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
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; }
--- a/layer/NoteLayer.h Mon Feb 18 14:33:35 2019 +0000 +++ b/layer/NoteLayer.h Tue Mar 05 10:02:48 2019 +0000 @@ -155,6 +155,7 @@ NoteModel::Point m_originalPoint; NoteModel::Point m_editingPoint; NoteModel::EditCommand *m_editingCommand; + bool m_editIsOpen; VerticalScale m_verticalScale; typedef std::set<NoteModel::Point, NoteModel::Point::Comparator> NoteSet;