Skip to content

Commit 5ec4be2

Browse files
committed
Update key signature and scale highlighting
1 parent 4085b57 commit 5ec4be2

File tree

9 files changed

+36
-5
lines changed

9 files changed

+36
-5
lines changed

src/plugins/coreplugin/internal/colorscheme/ColorSchemeCollection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ namespace Core::Internal {
6767
{"levelMeterColor", QVariant::fromValue(QColor(0x111112))},
6868
{"editAreaPrimaryColor", QVariant::fromValue(QColor(0x333740))},
6969
{"editAreaSecondaryColor", QVariant::fromValue(QColor(0x444954))},
70-
{"editAreaPrimaryHighlightColor", QVariant::fromValue(QColor(0x5566ff))},
71-
{"editAreaSecondaryHighlightColor", QVariant::fromValue(QColor(0x7d8aff))}, // TODO
70+
{"editAreaPrimaryHighlightColor", QVariant::fromValue(QColor(0x3c4370))},
71+
{"editAreaSecondaryHighlightColor", QVariant::fromValue(QColor(0x48507f))}, // TODO
7272
{"playheadPrimaryColor", QVariant::fromValue(QColor(0xcc4455))},
7373
{"playheadSecondaryColor", QVariant::fromValue(QColor::fromRgba(0x7fcc4455))},
7474
{"cursorIndicatorColor", QVariant::fromValue(QColor::fromRgba(0xbf00bfff))},

src/plugins/visualeditor/core/PianoRollPanelInterface.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,19 @@ namespace VisualEditor {
529529
}
530530
}
531531

532+
bool PianoRollPanelInterface::isScaleHighlightEnabled() const {
533+
Q_D(const PianoRollPanelInterface);
534+
return d->scaleHighlightEnabled;
535+
}
536+
537+
void PianoRollPanelInterface::setScaleHighlightEnabled(bool enabled) {
538+
Q_D(PianoRollPanelInterface);
539+
if (d->scaleHighlightEnabled != enabled) {
540+
d->scaleHighlightEnabled = enabled;
541+
Q_EMIT scaleHighlightEnabledChanged();
542+
}
543+
}
544+
532545
dspx::SingingClip *PianoRollPanelInterface::editingClip() const {
533546
Q_D(const PianoRollPanelInterface);
534547
auto items = d->editingClipSelectionModel->clipSelectionModel()->selectedItems();

src/plugins/visualeditor/core/PianoRollPanelInterface.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ namespace VisualEditor {
6464
Q_PROPERTY(Tool tool READ tool WRITE setTool NOTIFY toolChanged)
6565
Q_PROPERTY(bool snapTemporarilyDisabled READ isSnapTemporarilyDisabled WRITE setSnapTemporarilyDisabled NOTIFY snapTemporarilyDisabledChanged)
6666
Q_PROPERTY(bool mouseTrackingDisabled READ isMouseTrackingDisabled WRITE setMouseTrackingDisabled NOTIFY mouseTrackingDisabledChanged)
67+
Q_PROPERTY(bool scaleHighlightEnabled READ isScaleHighlightEnabled WRITE setScaleHighlightEnabled NOTIFY scaleHighlightEnabledChanged)
6768
Q_PROPERTY(dspx::SingingClip *editingClip READ editingClip WRITE setEditingClip NOTIFY editingClipChanged)
6869
Q_PROPERTY(int implicitNoteLength READ implicitNoteLength WRITE setImplicitNoteLength NOTIFY implicitNoteLengthChanged)
6970
public:
@@ -108,6 +109,9 @@ namespace VisualEditor {
108109
bool isMouseTrackingDisabled() const;
109110
void setMouseTrackingDisabled(bool disabled);
110111

112+
bool isScaleHighlightEnabled() const;
113+
void setScaleHighlightEnabled(bool enabled);
114+
111115
dspx::SingingClip *editingClip() const;
112116
void setEditingClip(dspx::SingingClip *clip);
113117

@@ -118,6 +122,7 @@ namespace VisualEditor {
118122
void toolChanged();
119123
void snapTemporarilyDisabledChanged();
120124
void mouseTrackingDisabledChanged();
125+
void scaleHighlightEnabledChanged();
121126
void editingClipChanged();
122127
void implicitNoteLengthChanged();
123128

src/plugins/visualeditor/core/PianoRollPanelInterface_p.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ namespace VisualEditor {
4848
PianoRollPanelInterface::Tool tool{PianoRollPanelInterface::PointerTool};
4949
bool isSnapTemporarilyDisabled{false};
5050
bool isMouseTrackingDisabled{false};
51+
bool scaleHighlightEnabled{false};
5152

5253
dspx::SelectionModel *editingClipSelectionModel;
5354
int implicitNoteLength{480};

src/plugins/visualeditor/core/viewmodelbinding/KeySignatureViewModelContextData.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ namespace VisualEditor {
207207

208208
qCDebug(lcKeySignatureViewModelContextData) << "KeySignature view item pos updated" << viewItem << viewItem->position();
209209
transactionalUpdatedKeySignatures.insert(viewItem);
210+
item->setPos(viewItem->position());
210211
});
211212

212213
keySignatureSequenceViewModel->insertItem(viewItem);
@@ -292,7 +293,7 @@ namespace VisualEditor {
292293
for (auto viewItem : transactionalUpdatedKeySignatures) {
293294
auto item = keySignatureDocumentItemMap.value(viewItem);
294295
Q_ASSERT(item);
295-
item->setPos(viewItem->position());
296+
// Position is already synchronized immediately, no need to set it here
296297
updatedItems.insert(item);
297298
}
298299
transactionalUpdatedKeySignatures.clear();

src/plugins/visualeditor/qml/PianoRollView.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ Item {
416416
timeViewModel: view.pianoRollPanelInterface?.timeViewModel ?? null
417417
timeLayoutViewModel: view.pianoRollPanelInterface?.timeLayoutViewModel ?? null
418418
clavierViewModel: view.pianoRollPanelInterface?.clavierViewModel ?? null
419-
scaleHighlightSequenceViewModel: view.projectViewModelContext?.scaleHighlightSequenceViewModel ?? null
419+
scaleHighlightSequenceViewModel: view.pianoRollPanelInterface?.scaleHighlightEnabled ? (view.projectViewModelContext?.scaleHighlightSequenceViewModel ?? null) : null
420420
}
421421
Item {
422422
id: noteEditLayerSequenceStack

src/plugins/visualeditor/qml/actions/PianoRollAddOnActions.qml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,15 @@ ActionCollection {
210210
}
211211
}
212212

213+
ActionItem {
214+
actionId: "org.diffscope.visualeditor.pianoRollPanel.highlightScale"
215+
Action {
216+
checkable: true
217+
checked: d.pianoRollPanelInterface?.scaleHighlightEnabled ?? false
218+
onTriggered: d.pianoRollPanelInterface.scaleHighlightEnabled = checked
219+
}
220+
}
221+
213222
ActionItem {
214223
actionId: "org.diffscope.visualeditor.pianoRollPanel.autoPageScrolling"
215224
Action {

src/plugins/visualeditor/res/org.diffscope.visualeditor_actions.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<action id="org.diffscope.visualeditor.pianoRollPanel.snapTuplet" diffscope:componentType="menu" />
6161
<action id="org.diffscope.visualeditor.pianoRollPanel.autoPageScrolling" icon="playhead_panel_chevron_double" />
6262
<action id="org.diffscope.visualeditor.pianoRollPanel.editingClip" diffscope:componentType="widget" />
63+
<action id="org.diffscope.visualeditor.pianoRollPanel.highlightScale" />
6364
<action id="org.diffscope.visualeditor.pianoRollPanel.showTrackSelector" icon="navigation" />
6465

6566
<action id="org.diffscope.visualeditor.panel.arrangement" catalog="org.diffscope.core.workspacePanelWidgets" icon="gantt_chart" diffscope:uniquePanel="true" diffscope:componentType="custom"/>
@@ -142,6 +143,7 @@
142143
<group id="org.diffscope.visualeditor.pianoRollPanelToolBar.editingClipActions">
143144
<action id="org.diffscope.visualeditor.pianoRollPanel.editingClip" />
144145
</group>
146+
<action id="org.diffscope.visualeditor.pianoRollPanel.highlightScale" />
145147
<stretch />
146148
<action id="org.diffscope.visualeditor.pianoRollPanel.autoPageScrolling" />
147149
</menu>

0 commit comments

Comments
 (0)