X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fglobalsettings.hpp;h=adb9168a1fbc3be027db6f7ee16df0930b501de4;hb=a3c57f445a469cd9fc7ec02d529d9425a94b2256;hp=b5cd24fd5ad809a3fcb769fa503523229864726b;hpb=1ed996b433f3391f54846784d76da4fe6b07500f;p=pulseview.git diff --git a/pv/globalsettings.hpp b/pv/globalsettings.hpp index b5cd24fd..adb9168a 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,19 +51,31 @@ class GlobalSettings : public QSettings Q_OBJECT public: + static const QString Key_General_Language; + 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_View_CursorShowInterval; + static const QString Key_View_CursorShowFrequency; + static const QString Key_View_CursorShowSamples; 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; @@ -71,7 +88,15 @@ 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(); + + void apply_language(); static void add_change_handler(GlobalSettingsInterface *cb); static void remove_change_handler(GlobalSettingsInterface *cb); @@ -109,6 +134,11 @@ private: static bool tracking_; static map tracked_changes_; + + static QString default_style_; + static QPalette default_palette_; + + static bool is_dark_theme_; }; } // namespace pv