Skip to content

Commit

Permalink
EXPERIMENTAL_THEME_PREFS redone with constexpr if
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Licameli committed Apr 2, 2024
1 parent 2a822e4 commit 5b04447
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
4 changes: 4 additions & 0 deletions libraries/lib-utility/Experimental.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions src/Experimental.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions src/prefs/GUIPrefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
12 changes: 6 additions & 6 deletions src/prefs/ThemePrefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ icons and colours.
\see \ref Themability
*//********************************************************************/


#include "ThemePrefs.h"

#include <wx/app.h>
#include <wx/wxprec.h>
#include "ConditionallyPresent.h"
#include "Experimental.h"
#include "Prefs.h"
#include "Theme.h"
#include "ShuttleGui.h"
Expand Down Expand Up @@ -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
Expand All @@ -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
11 changes: 5 additions & 6 deletions src/toolbars/ToolBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 5b04447

Please sign in to comment.