X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fglobalsettings.hpp;h=a65a723c0c0e85f4704fa38bb712a8e68276c0ba;hp=276a968247b11b585d8583e3a0a2423eecb1108c;hb=8962d7b3b640b5f07f26a4b4ebee839c4880b69d;hpb=1325ce422f1b49ab1f693125105b8c373c2965e5 diff --git a/pv/globalsettings.hpp b/pv/globalsettings.hpp index 276a9682..a65a723c 100644 --- a/pv/globalsettings.hpp +++ b/pv/globalsettings.hpp @@ -25,15 +25,20 @@ #include #include +#include #include #include #include using std::map; +using std::pair; using std::vector; namespace pv { +extern const vector< pair > Themes; + + class GlobalSettingsInterface { public: @@ -46,17 +51,26 @@ class GlobalSettings : public QSettings Q_OBJECT public: + static const QString Key_General_Theme; + static const QString Key_General_Style; + static const QString Key_General_SaveWithSetup; static const QString Key_View_ZoomToFitDuringAcq; static const QString Key_View_ZoomToFitAfterAcq; static const QString Key_View_TriggerIsZeroTime; static const QString Key_View_ColoredBG; static const QString Key_View_StickyScrolling; static const QString Key_View_ShowSamplingPoints; + static const QString Key_View_FillSignalHighAreas; + static const QString Key_View_FillSignalHighAreaColor; static const QString Key_View_ShowAnalogMinorGrid; static const QString Key_View_ConversionThresholdDispMode; static const QString Key_View_DefaultDivHeight; static const QString Key_View_DefaultLogicHeight; + static const QString Key_View_ShowHoverMarker; + static const QString Key_View_SnapDistance; + static const QString Key_View_CursorFillColor; static const QString Key_Dec_InitialStateConfigurable; + static const QString Key_Dec_ExportFormat; static const QString Key_Log_BufferSize; static const QString Key_Log_NotifyOfStacktrace; @@ -69,7 +83,13 @@ public: public: GlobalSettings(); + void save_internal_defaults(); void set_defaults_where_needed(); + void set_bright_theme_default_colors(); + void set_dark_theme_default_colors(); + + bool current_theme_is_dark(); + void apply_theme(); static void add_change_handler(GlobalSettingsInterface *cb); static void remove_change_handler(GlobalSettingsInterface *cb); @@ -107,6 +127,11 @@ private: static bool tracking_; static map tracked_changes_; + + static QString default_style_; + static QPalette default_palette_; + + bool is_dark_theme_; }; } // namespace pv