X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fglobalsettings.hpp;h=6f32bf01ebbb8d959ce531a17ef1e55b0a16bba8;hp=6e027d782c97dd3e4a449e72282fa8c2ad55e646;hb=a42d2514a57051f971e7b239bc3765ebf93669ae;hpb=4521022bf4ea07aff38bfa09fe0f7d5702b26475 diff --git a/pv/globalsettings.hpp b/pv/globalsettings.hpp index 6e027d7..6f32bf0 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,6 +51,8 @@ class GlobalSettings : public QSettings Q_OBJECT public: + static const QString Key_General_Theme; + static const QString Key_General_Style; static const QString Key_View_ZoomToFitDuringAcq; static const QString Key_View_ZoomToFitAfterAcq; static const QString Key_View_TriggerIsZeroTime; @@ -74,7 +81,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); @@ -112,6 +125,11 @@ private: static bool tracking_; static map tracked_changes_; + + static QString default_style_; + static QPalette default_palette_; + + bool is_dark_theme_; }; } // namespace pv