X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fglobalsettings.hpp;h=6902a097406edb187c53c5effc7c550aa26e4165;hb=c6b4e925a8c5d855a70ab2815e8bc1c371d5801a;hp=40dc1b3c5e94d0cda96e8078a7f166f45609b254;hpb=1931b5f932cf068d073bc798f11dd21ede5389a2;p=pulseview.git diff --git a/pv/globalsettings.hpp b/pv/globalsettings.hpp index 40dc1b3c..6902a097 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,18 +51,27 @@ 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_Dec_AlwaysShowAllRows; static const QString Key_Log_BufferSize; static const QString Key_Log_NotifyOfStacktrace; @@ -70,7 +84,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(); + + static bool current_theme_is_dark(); + void apply_theme(); static void add_change_handler(GlobalSettingsInterface *cb); static void remove_change_handler(GlobalSettingsInterface *cb); @@ -108,6 +128,11 @@ private: static bool tracking_; static map tracked_changes_; + + static QString default_style_; + static QPalette default_palette_; + + static bool is_dark_theme_; }; } // namespace pv