@@ -25,6 +25,8 @@ namespace VisualEditor::Internal {
2525 bool displayPronunciationBelowNote{};
2626 int shortNoteThreshold{30 };
2727 bool trackCursorPosition{true };
28+ bool showSingerBackground{true };
29+ double singerBackgroundOpacity{0.25 };
2830 };
2931
3032 static EditorPreference *m_instance = nullptr ;
@@ -72,6 +74,11 @@ namespace VisualEditor::Internal {
7274 emit shortNoteThresholdChanged ();
7375 d->trackCursorPosition = settings->value (" trackCursorPosition" , true ).toBool ();
7476 emit trackCursorPositionChanged ();
77+ d->showSingerBackground = settings->value (" showSingerBackground" , true ).toBool ();
78+ emit showSingerBackgroundChanged ();
79+ d->singerBackgroundOpacity = qBound (
80+ 0.0 , settings->value (" singerBackgroundOpacity" , 0.25 ).toDouble (), 1.0 );
81+ emit singerBackgroundOpacityChanged ();
7582 settings->endGroup ();
7683 }
7784
@@ -92,6 +99,8 @@ namespace VisualEditor::Internal {
9299 settings->setValue (" displayPronunciationBelowNote" , d->displayPronunciationBelowNote );
93100 settings->setValue (" shortNoteThreshold" , d->shortNoteThreshold );
94101 settings->setValue (" trackCursorPosition" , d->trackCursorPosition );
102+ settings->setValue (" showSingerBackground" , d->showSingerBackground );
103+ settings->setValue (" singerBackgroundOpacity" , d->singerBackgroundOpacity );
95104 settings->endGroup ();
96105 }
97106
@@ -267,4 +276,31 @@ namespace VisualEditor::Internal {
267276 emit m_instance->trackCursorPositionChanged ();
268277 }
269278
279+ bool EditorPreference::showSingerBackground () {
280+ M_INSTANCE_D ;
281+ return d->showSingerBackground ;
282+ }
283+
284+ void EditorPreference::setShowSingerBackground (bool showSingerBackground) {
285+ M_INSTANCE_D ;
286+ if (d->showSingerBackground == showSingerBackground)
287+ return ;
288+ d->showSingerBackground = showSingerBackground;
289+ emit m_instance->showSingerBackgroundChanged ();
290+ }
291+
292+ double EditorPreference::singerBackgroundOpacity () {
293+ M_INSTANCE_D ;
294+ return d->singerBackgroundOpacity ;
295+ }
296+
297+ void EditorPreference::setSingerBackgroundOpacity (double singerBackgroundOpacity) {
298+ M_INSTANCE_D ;
299+ singerBackgroundOpacity = qBound (0.0 , singerBackgroundOpacity, 1.0 );
300+ if (qFuzzyCompare (d->singerBackgroundOpacity , singerBackgroundOpacity))
301+ return ;
302+ d->singerBackgroundOpacity = singerBackgroundOpacity;
303+ emit m_instance->singerBackgroundOpacityChanged ();
304+ }
305+
270306}
0 commit comments