diff --git a/libraries/lib-utility/Experimental.h b/libraries/lib-utility/Experimental.h index e0f1ea4351f1..3ff928661290 100644 --- a/libraries/lib-utility/Experimental.h +++ b/libraries/lib-utility/Experimental.h @@ -33,6 +33,10 @@ namespace Experimental { // JKC an experiment to work around bug 2709 constexpr bool CeeNumbersOption = false; + +// August 2009 - Theming not locked down enough for a stable release. +// This turns on the Theme panel in Prefs dialog. +constexpr bool ThemePrefs = false; } #endif diff --git a/src/Experimental.cmake b/src/Experimental.cmake index 93f11056777f..48643f20f6eb 100644 --- a/src/Experimental.cmake +++ b/src/Experimental.cmake @@ -32,10 +32,6 @@ set( EXPERIMENTAL_OPTIONS_LIST # EQ accelerated code #EQ_SSE_THREADED - #August 2009 - Theming not locked down enough for a stable release. - # This turns on the Theme panel in Prefs dialog. - #THEME_PREFS - #ROLL_UP_DIALOG #RIGHT_ALIGNED_TEXTBOXES #VOICE_DETECTION diff --git a/src/prefs/GUIPrefs.cpp b/src/prefs/GUIPrefs.cpp index 97c8de661bb2..e809c2a49a00 100644 --- a/src/prefs/GUIPrefs.cpp +++ b/src/prefs/GUIPrefs.cpp @@ -165,13 +165,12 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S) S.TieCheckBox(XXO("Show e&xtra menus"), {wxT("/GUI/ShowExtraMenus"), false}); -#ifdef EXPERIMENTAL_THEME_PREFS - // We do not want to make this option mainstream. It's a - // convenience for developers. - S.TieCheckBox(XXO("Show alternative &styling (Mac vs PC)"), - {wxT("/GUI/ShowMac"), - false}); -#endif + if constexpr (Experimental::ThemePrefs) + // We do not want to make this option mainstream. It's a + // convenience for developers. + S.TieCheckBox(XXO("Show alternative &styling (Mac vs PC)"), + {wxT("/GUI/ShowMac"), + false}); S.TieCheckBox(XXO("&Beep on completion of longer activities"), {wxT("/GUI/BeepOnCompletion"), false}); diff --git a/src/prefs/ThemePrefs.cpp b/src/prefs/ThemePrefs.cpp index f337a28bf20a..e517e526f4a8 100644 --- a/src/prefs/ThemePrefs.cpp +++ b/src/prefs/ThemePrefs.cpp @@ -27,12 +27,12 @@ icons and colours. \see \ref Themability *//********************************************************************/ - - #include "ThemePrefs.h" #include #include +#include "ConditionallyPresent.h" +#include "Experimental.h" #include "Prefs.h" #include "Theme.h" #include "ShuttleGui.h" @@ -257,9 +257,10 @@ void ThemePrefs::Cancel() AColor::ApplyUpdatedImages(); } -#ifdef EXPERIMENTAL_THEME_PREFS namespace{ -PrefsPanel::Registration sAttachment{ "Theme", +ConditionallyPresent< + PrefsPanel::Registration, Experimental::ThemePrefs +> sAttachment{ "Theme", [](wxWindow *parent, wxWindowID winid, AudacityProject *) { wxASSERT(parent); // to justify safenew @@ -268,7 +269,6 @@ PrefsPanel::Registration sAttachment{ "Theme", false, // Register with an explicit ordering hint because this one is // only conditionally compiled - { "", { Registry::OrderingHint::After, "Effects" } } + Registry::Placement{ "", { Registry::OrderingHint::After, "Effects" } } }; } -#endif diff --git a/src/toolbars/ToolBar.cpp b/src/toolbars/ToolBar.cpp index 9979d08164da..7f782c607a95 100644 --- a/src/toolbars/ToolBar.cpp +++ b/src/toolbars/ToolBar.cpp @@ -46,6 +46,7 @@ in which buttons can be placed. #include "AllThemeResources.h" #include "AColor.h" +#include "Experimental.h" #include "ImageManipulation.h" #include "Project.h" #include "CommandManager.h" @@ -813,9 +814,8 @@ void ToolBar:: MakeButtonBackgroundsLarge() bool bUseAqua = false; -#ifdef EXPERIMENTAL_THEME_PREFS - gPrefs->Read( wxT("/GUI/ShowMac"), &bUseAqua, false); -#endif + if constexpr (Experimental::ThemePrefs) + gPrefs->Read( wxT("/GUI/ShowMac"), &bUseAqua, false); #ifdef USE_AQUA_THEME bUseAqua = !bUseAqua; @@ -839,9 +839,8 @@ void ToolBar::MakeButtonBackgroundsSmall() bool bUseAqua = false; -#ifdef EXPERIMENTAL_THEME_PREFS - gPrefs->Read( wxT("/GUI/ShowMac"), &bUseAqua, false); -#endif + if constexpr (Experimental::ThemePrefs) + gPrefs->Read( wxT("/GUI/ShowMac"), &bUseAqua, false); #ifdef USE_AQUA_THEME bUseAqua = !bUseAqua;