From fab958c1826558b2a4a40e38abbf55fe2d811a3e Mon Sep 17 00:00:00 2001 From: Avery King Date: Tue, 8 Aug 2023 14:54:09 -0700 Subject: [PATCH] Remove usage of Aqua theme resources For compatibility reasons, Aqua resources still remain part of Tenacity's theme resources. They will be removed in a later theme system update. Signed-off-by: Avery King --- images/ControlButtons.h | 11 ------- images/EditButtons.h | 6 ---- images/TranscriptionButtons.h | 6 ---- src/CMakeLists.txt | 3 -- src/ImageManipulation.cpp | 40 ++++--------------------- src/ImageManipulation.h | 10 ------- src/prefs/GUIPrefs.cpp | 7 ----- src/tenacity_config.h.in | 3 -- src/toolbars/ControlToolBar.cpp | 3 -- src/toolbars/ToolBar.cpp | 52 +++++---------------------------- src/toolbars/ToolBar.h | 4 --- src/widgets/MeterPanel.cpp | 3 -- 12 files changed, 13 insertions(+), 135 deletions(-) diff --git a/images/ControlButtons.h b/images/ControlButtons.h index 01a77f5b20..ef57683d8d 100644 --- a/images/ControlButtons.h +++ b/images/ControlButtons.h @@ -1,19 +1,8 @@ #ifndef HAVE_SHARED_BUTTONS -#ifdef USE_AQUA_THEME -#include "Aqua/UpButtonSquare.xpm" -#include "Aqua/DownButtonSquare.xpm" -#include "Aqua/HiliteButtonSquare.xpm" -//#include "Aqua/Up.xpm" -//#include "Aqua/Down.xpm" -//#include "Aqua/Hilite.xpm" -#include "Aqua/SliderThumb.xpm" -#include "Aqua/Slider.xpm" -#else #include "ControlButtons/UpButton.xpm" #include "ControlButtons/DownButton.xpm" #include "ControlButtons/HiliteButton.xpm" #endif -#endif #include "ControlButtons/FFwdAlpha.xpm" #include "ControlButtons/FFwdDisabled.xpm" diff --git a/images/EditButtons.h b/images/EditButtons.h index 0f46cc10d7..8748114b3c 100644 --- a/images/EditButtons.h +++ b/images/EditButtons.h @@ -1,12 +1,6 @@ -#ifdef USE_AQUA_THEME -#include "Aqua/Up.xpm" -#include "Aqua/Down.xpm" -#include "Aqua/Hilite.xpm" -#else #include "EditButtons/Up.xpm" #include "EditButtons/Down.xpm" #include "EditButtons/Hilite.xpm" -#endif #include "EditButtons/CopyAlpha.xpm" #include "EditButtons/CutAlpha.xpm" diff --git a/images/TranscriptionButtons.h b/images/TranscriptionButtons.h index 92071898bb..11751819ad 100644 --- a/images/TranscriptionButtons.h +++ b/images/TranscriptionButtons.h @@ -1,14 +1,8 @@ #ifndef HAVE_SHARED_BUTTONS -#ifdef USE_AQUA_THEME -#include "Aqua/Up.xpm" -#include "Aqua/Down.xpm" -#include "Aqua/Hilite.xpm" -#else #include "EditButtons/Up.xpm" #include "EditButtons/Down.xpm" #include "EditButtons/Hilite.xpm" #endif -#endif #include "TranscriptionImages/StartOn.xpm" #include "TranscriptionImages/StartOnAlpha.xpm" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 36ea052485..424fc162fd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1207,9 +1207,6 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) "-framework CoreAudioKit") endif() - # Use the Aqua theme - set( USE_AQUA_THEME 1 ) - # Copy the required wxWidgets libs into the bundle add_custom_command( TARGET diff --git a/src/ImageManipulation.cpp b/src/ImageManipulation.cpp index 7658215f73..9e27502364 100644 --- a/src/ImageManipulation.cpp +++ b/src/ImageManipulation.cpp @@ -256,8 +256,11 @@ std::unique_ptr OverlayImage(teBmps eBack, teBmps eForeground, return dstImage; } -// Creates an image with a solid background color -std::unique_ptr CreateBackground(int width, int height, wxColour colour) +std::unique_ptr CreateBackground( + int width, + int height, + wxColour colour +) { auto i = std::make_unique(width, height); unsigned char *ip; @@ -278,39 +281,6 @@ std::unique_ptr CreateBackground(int width, int height, wxColour colour return i; } -// Creates an image with the Mac OS X Aqua stripes, to be used -// as a background -std::unique_ptr CreateAquaBackground(int width, int height, int offset) -{ - auto image = std::make_unique(width, height); - unsigned char *ip = image->GetData(); - unsigned char val[4] = {231, 239, 255, 239}; - unsigned char v; - int x, y; - - for(y=0; y CreateSysBackground -#ifdef USE_AQUA_THEME - (int width, int height, int offset, wxColour colour) -#else - (int width, int height, int WXUNUSED(offset), wxColour colour) -#endif -{ - #ifdef USE_AQUA_THEME - return CreateAquaBackground(width, height, offset); - #else - return CreateBackground(width, height, colour); - #endif -} - /// Pastes one image into another including the alpha channel. /// Differs from OverlayImage in that: /// Happens in place to existing background image. diff --git a/src/ImageManipulation.h b/src/ImageManipulation.h index 912213f5b4..6f0317d399 100644 --- a/src/ImageManipulation.h +++ b/src/ImageManipulation.h @@ -58,16 +58,6 @@ std::unique_ptr OverlayImage(teBmps eBack, teBmps eForeground, TENACITY_DLL_API std::unique_ptr CreateBackground(int width, int height, wxColour colour); -// Creates an image with the Mac OS X Aqua stripes, to be used -// as a background -TENACITY_DLL_API -std::unique_ptr CreateAquaBackground(int width, int height, int offset); - -// Uses color on all OS except Mac, uses Aqua -TENACITY_DLL_API -std::unique_ptr CreateSysBackground(int width, int height, int offset, - wxColour colour); - // Pastes one image into another at specified location. TENACITY_DLL_API void PasteSubImage( wxImage * pDest, wxImage * pSrc, int x, int y ); diff --git a/src/prefs/GUIPrefs.cpp b/src/prefs/GUIPrefs.cpp index 1e6a93e563..3816df7f93 100644 --- a/src/prefs/GUIPrefs.cpp +++ b/src/prefs/GUIPrefs.cpp @@ -189,13 +189,6 @@ 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 S.TieCheckBox(XXO("&Beep on completion of longer activities"), {wxT("/GUI/BeepOnCompletion"), false}); diff --git a/src/tenacity_config.h.in b/src/tenacity_config.h.in index 10c48fa05b..94613a6dd8 100644 --- a/src/tenacity_config.h.in +++ b/src/tenacity_config.h.in @@ -101,6 +101,3 @@ /* We're using cygwin */ #cmakedefine __CYGWIN__ 1 - -/* Use the Aqua theme on Mac */ -#cmakedefine USE_AQUA_THEME 1 diff --git a/src/toolbars/ControlToolBar.cpp b/src/toolbars/ControlToolBar.cpp index 2602639cb1..21586d6fad 100644 --- a/src/toolbars/ControlToolBar.cpp +++ b/src/toolbars/ControlToolBar.cpp @@ -468,11 +468,8 @@ void ControlToolBar::ReCreateButtons() void ControlToolBar::Repaint( wxDC *dc ) { -#ifndef USE_AQUA_THEME wxSize s = mSizer->GetSize(); wxPoint p = mSizer->GetPosition(); - -#endif } void ControlToolBar::EnableDisableButtons() diff --git a/src/toolbars/ToolBar.cpp b/src/toolbars/ToolBar.cpp index ddf10b31e6..0ef9ba0c4e 100644 --- a/src/toolbars/ToolBar.cpp +++ b/src/toolbars/ToolBar.cpp @@ -808,54 +808,18 @@ void ToolBar::MakeRecoloredImage( teBmps eBmpOut, teBmps eBmpIn ) void ToolBar:: MakeButtonBackgroundsLarge() { - - bool bUseAqua = false; - -#ifdef EXPERIMENTAL_THEME_PREFS - gPrefs->Read( wxT("/GUI/ShowMac"), &bUseAqua, false); -#endif - -#ifdef USE_AQUA_THEME - bUseAqua = !bUseAqua; -#endif - - if( bUseAqua ){ - MakeMacRecoloredImage( bmpRecoloredUpLarge, bmpMacUpButton ); - MakeMacRecoloredImage( bmpRecoloredDownLarge, bmpMacDownButton ); - MakeMacRecoloredImage( bmpRecoloredUpHiliteLarge, bmpMacHiliteUpButton ); - MakeMacRecoloredImage( bmpRecoloredHiliteLarge, bmpMacHiliteButton ); - } else { - MakeRecoloredImage( bmpRecoloredUpLarge, bmpUpButtonLarge ); - MakeRecoloredImage( bmpRecoloredDownLarge, bmpDownButtonLarge ); - MakeRecoloredImage( bmpRecoloredUpHiliteLarge, bmpHiliteUpButtonLarge ); - MakeRecoloredImage( bmpRecoloredHiliteLarge, bmpHiliteButtonLarge ); - } + MakeRecoloredImage( bmpRecoloredUpLarge, bmpUpButtonLarge ); + MakeRecoloredImage( bmpRecoloredDownLarge, bmpDownButtonLarge ); + MakeRecoloredImage( bmpRecoloredUpHiliteLarge, bmpHiliteUpButtonLarge ); + MakeRecoloredImage( bmpRecoloredHiliteLarge, bmpHiliteButtonLarge ); } void ToolBar::MakeButtonBackgroundsSmall() { - - bool bUseAqua = false; - -#ifdef EXPERIMENTAL_THEME_PREFS - gPrefs->Read( wxT("/GUI/ShowMac"), &bUseAqua, false); -#endif - -#ifdef USE_AQUA_THEME - bUseAqua = !bUseAqua; -#endif - - if( bUseAqua ){ - MakeMacRecoloredImage( bmpRecoloredUpSmall, bmpMacUpButtonSmall ); - MakeMacRecoloredImage( bmpRecoloredDownSmall, bmpMacDownButtonSmall ); - MakeMacRecoloredImage( bmpRecoloredUpHiliteSmall, bmpMacHiliteUpButtonSmall ); - MakeMacRecoloredImage( bmpRecoloredHiliteSmall, bmpMacHiliteButtonSmall ); - } else { - MakeRecoloredImage( bmpRecoloredUpSmall, bmpUpButtonSmall ); - MakeRecoloredImage( bmpRecoloredDownSmall, bmpDownButtonSmall ); - MakeRecoloredImage( bmpRecoloredUpHiliteSmall, bmpHiliteUpButtonSmall ); - MakeRecoloredImage( bmpRecoloredHiliteSmall, bmpHiliteButtonSmall ); - } + MakeRecoloredImage( bmpRecoloredUpSmall, bmpUpButtonSmall ); + MakeRecoloredImage( bmpRecoloredDownSmall, bmpDownButtonSmall ); + MakeRecoloredImage( bmpRecoloredUpHiliteSmall, bmpHiliteUpButtonSmall ); + MakeRecoloredImage( bmpRecoloredHiliteSmall, bmpHiliteButtonSmall ); } /// Makes a button and its four different state bitmaps diff --git a/src/toolbars/ToolBar.h b/src/toolbars/ToolBar.h index 2f870a18b9..1fdb5942f7 100644 --- a/src/toolbars/ToolBar.h +++ b/src/toolbars/ToolBar.h @@ -42,10 +42,6 @@ class ToolDock; class ToolBarResizer; -#ifdef __WXMAC__ -#define USE_AQUA_THEME 1 -#endif - //////////////////////////////////////////////////////////// /// class ToolBar //////////////////////////////////////////////////////////// diff --git a/src/widgets/MeterPanel.cpp b/src/widgets/MeterPanel.cpp index 88a424669d..b9093f6f43 100644 --- a/src/widgets/MeterPanel.cpp +++ b/src/widgets/MeterPanel.cpp @@ -496,8 +496,6 @@ void MeterPanel::OnPaint(wxPaintEvent & WXUNUSED(event)) HandleLayout(dc); // Start with a clean background - // LLL: Should research USE_AQUA_THEME usefulness... -//#ifndef USE_AQUA_THEME #ifdef EXPERIMENTAL_THEMING //if( !mMeterDisabled ) //{ @@ -509,7 +507,6 @@ void MeterPanel::OnPaint(wxPaintEvent & WXUNUSED(event)) dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(mBkgndBrush); dc.DrawRectangle(0, 0, mWidth, mHeight); -//#endif // MixerTrackCluster style has no icon or L/R labels if (mStyle != MixerTrackCluster)