+ if (!contains(Key_General_Language)) {
+ // Determine and set default UI language
+ QString language = QLocale().uiLanguages().first(); // May return e.g. en-Latn-US // clazy:exclude=detaching-temporary
+ language = language.split("-").first();
+
+ setValue(Key_General_Language, language);
+ apply_language();
+ }
+
+ // Use no theme by default
+ if (!contains(Key_General_Theme))
+ setValue(Key_General_Theme, 0);
+ if (!contains(Key_General_Style))
+ setValue(Key_General_Style, "");
+
+ // Save setup with .sr files by default
+ if (!contains(Key_General_SaveWithSetup))
+ setValue(Key_General_SaveWithSetup, true);
+
+ // Enable zoom-to-fit after acquisition by default
+ if (!contains(Key_View_ZoomToFitAfterAcq))
+ setValue(Key_View_ZoomToFitAfterAcq, true);
+
+ // Allow vertical dragging by default
+ if (!contains(Key_View_AllowVerticalDragging))
+ setValue(Key_View_AllowVerticalDragging, true);
+
+ // Enable colored trace backgrounds by default
+ if (!contains(Key_View_ColoredBG))
+ setValue(Key_View_ColoredBG, true);
+
+ // Enable showing sampling points by default
+ if (!contains(Key_View_ShowSamplingPoints))
+ setValue(Key_View_ShowSamplingPoints, true);
+
+ // Enable filling logic signal high areas by default
+ if (!contains(Key_View_FillSignalHighAreas))
+ setValue(Key_View_FillSignalHighAreas, true);
+
+ if (!contains(Key_View_DefaultDivHeight))
+ setValue(Key_View_DefaultDivHeight,
+ 3 * QFontMetrics(QApplication::font()).height());
+
+ if (!contains(Key_View_DefaultLogicHeight))
+ setValue(Key_View_DefaultLogicHeight,
+ 2 * QFontMetrics(QApplication::font()).height());
+
+ if (!contains(Key_View_ShowHoverMarker))
+ setValue(Key_View_ShowHoverMarker, true);
+
+ if (!contains(Key_View_KeepRulerItemSelected))
+ setValue(Key_View_KeepRulerItemSelected, false);
+
+ if (!contains(Key_View_SnapDistance))
+ setValue(Key_View_SnapDistance, 15);
+
+ if (!contains(Key_View_CursorShowInterval))
+ setValue(Key_View_CursorShowInterval, true);
+
+ if (!contains(Key_View_CursorShowFrequency))
+ setValue(Key_View_CursorShowFrequency, true);
+
+ // %c was used for the row name in the past so we need to transition such users
+ if (!contains(Key_Dec_ExportFormat) ||
+ value(Key_Dec_ExportFormat).toString() == "%s %d: %c: %1")
+ setValue(Key_Dec_ExportFormat, "%s %d: %r: %1");
+
+ // Default to 500 lines of backlog
+ if (!contains(Key_Log_BufferSize))
+ setValue(Key_Log_BufferSize, 500);
+
+ // Notify user of existing stack trace by default
+ if (!contains(Key_Log_NotifyOfStacktrace))
+ setValue(Key_Log_NotifyOfStacktrace, true);
+
+ // Default theme is bright, so use its color scheme if undefined
+ if (!contains(Key_View_CursorFillColor))
+ set_bright_theme_default_colors();
+}
+
+void GlobalSettings::set_bright_theme_default_colors()
+{
+ setValue(Key_View_FillSignalHighAreaColor,
+ QColor(0, 0, 0, 5 * 256 / 100).rgba());
+
+ setValue(Key_View_CursorFillColor,
+ QColor(220, 231, 243).rgba());
+}
+
+void GlobalSettings::set_dark_theme_default_colors()
+{
+ setValue(Key_View_FillSignalHighAreaColor,
+ QColor(188, 188, 188, 9 * 256 / 100).rgba());
+
+ setValue(Key_View_CursorFillColor,
+ QColor(60, 60, 60).rgba());