From 0eafcd112b77192406e56e7af36081f55c0004c3 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 26 May 2020 14:08:25 -0400 Subject: [PATCH] Theme does not depend on GUIPrefs... ...breaks cycle of 6, still Theme in a cycle with ImageManipulation --- src/Theme.cpp | 36 +++++++++++++++++++++++++++++++++++- src/Theme.h | 6 ++++++ src/prefs/GUIPrefs.cpp | 36 ------------------------------------ src/prefs/GUIPrefs.h | 1 - 4 files changed, 41 insertions(+), 38 deletions(-) diff --git a/src/Theme.cpp b/src/Theme.cpp index 883ab8868..5944ae943 100644 --- a/src/Theme.cpp +++ b/src/Theme.cpp @@ -77,7 +77,6 @@ can't be. #include "Prefs.h" #include "ImageManipulation.h" #include "Internat.h" -#include "prefs/GUIPrefs.h" #include "widgets/AudacityMessageBox.h" // JKC: First get the MAC specific images. @@ -1299,4 +1298,39 @@ void auStaticText::OnPaint(wxPaintEvent & WXUNUSED(evt)) dc.DrawText( GetLabel(), 0,0); } +constexpr int defaultTheme = +#ifdef EXPERIMENTAL_DA + 2 // "dark" +#else + 1 // "light" +#endif +; + +ChoiceSetting GUITheme{ + wxT("/GUI/Theme"), + { + ByColumns, + { + /* i18n-hint: describing the "classic" or traditional + appearance of older versions of Audacity */ + XO("Classic") , + /* i18n-hint: Light meaning opposite of dark */ + XO("Light") , + XO("Dark") , + /* i18n-hint: greater difference between foreground and + background colors */ + XO("High Contrast") , + /* i18n-hint: user defined */ + XO("Custom") , + }, + { + wxT("classic") , + wxT("light") , + wxT("dark") , + wxT("high-contrast") , + wxT("custom") , + } + }, + defaultTheme +}; diff --git a/src/Theme.h b/src/Theme.h index 1e69b4f6e..ea5ab07b2 100644 --- a/src/Theme.h +++ b/src/Theme.h @@ -27,6 +27,8 @@ class wxFont; class wxImage; class wxPen; +class ChoiceSetting; + // JKC: will probably change name from 'teBmps' to 'tIndexBmp'; using teBmps = int; /// The index of a bitmap resource in Theme Resources. @@ -191,4 +193,8 @@ public: extern AUDACITY_DLL_API Theme theTheme; +extern ChoiceSetting + GUITheme +; + #endif // __AUDACITY_THEME__ diff --git a/src/prefs/GUIPrefs.cpp b/src/prefs/GUIPrefs.cpp index f94108c7f..ca4d09ecf 100644 --- a/src/prefs/GUIPrefs.cpp +++ b/src/prefs/GUIPrefs.cpp @@ -139,42 +139,6 @@ ChoiceSetting GUIManualLocation{ 0 // "Local" }; -constexpr int defaultTheme = -#ifdef EXPERIMENTAL_DA - 2 // "dark" -#else - 1 // "light" -#endif -; - -ChoiceSetting GUITheme{ - wxT("/GUI/Theme"), - { - ByColumns, - { - /* i18n-hint: describing the "classic" or traditional - appearance of older versions of Audacity */ - XO("Classic") , - /* i18n-hint: Light meaning opposite of dark */ - XO("Light") , - XO("Dark") , - /* i18n-hint: greater difference between foreground and - background colors */ - XO("High Contrast") , - /* i18n-hint: user defined */ - XO("Custom") , - }, - { - wxT("classic") , - wxT("light") , - wxT("dark") , - wxT("high-contrast") , - wxT("custom") , - } - }, - defaultTheme -}; - void GUIPrefs::PopulateOrExchange(ShuttleGui & S) { S.SetBorder(2); diff --git a/src/prefs/GUIPrefs.h b/src/prefs/GUIPrefs.h index bbb96053e..c4cb89e2b 100644 --- a/src/prefs/GUIPrefs.h +++ b/src/prefs/GUIPrefs.h @@ -70,7 +70,6 @@ int ShowClippingPrefsID(); extern ChoiceSetting GUIManualLocation - , GUITheme ; #endif