Skip to content

Commit

Permalink
Remove usage of Aqua theme resources
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
generic-pers0n committed Aug 10, 2023
1 parent d700e07 commit fab958c
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 135 deletions.
11 changes: 0 additions & 11 deletions images/ControlButtons.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 0 additions & 6 deletions images/EditButtons.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 0 additions & 6 deletions images/TranscriptionButtons.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 0 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 5 additions & 35 deletions src/ImageManipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,11 @@ std::unique_ptr<wxImage> OverlayImage(teBmps eBack, teBmps eForeground,
return dstImage;
}

// Creates an image with a solid background color
std::unique_ptr<wxImage> CreateBackground(int width, int height, wxColour colour)
std::unique_ptr<wxImage> CreateBackground(
int width,
int height,
wxColour colour
)
{
auto i = std::make_unique<wxImage>(width, height);
unsigned char *ip;
Expand All @@ -278,39 +281,6 @@ std::unique_ptr<wxImage> 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<wxImage> CreateAquaBackground(int width, int height, int offset)
{
auto image = std::make_unique<wxImage>(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<height; y++) {
v = val[(y+offset)%4];
for(x=0; x<width*3; x++)
*ip++ = v;
}

return image;
}

std::unique_ptr<wxImage> 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.
Expand Down
10 changes: 0 additions & 10 deletions src/ImageManipulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@ std::unique_ptr<wxImage> OverlayImage(teBmps eBack, teBmps eForeground,
TENACITY_DLL_API
std::unique_ptr<wxImage> 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<wxImage> CreateAquaBackground(int width, int height, int offset);

// Uses color on all OS except Mac, uses Aqua
TENACITY_DLL_API
std::unique_ptr<wxImage> 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 );
Expand Down
7 changes: 0 additions & 7 deletions src/prefs/GUIPrefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
3 changes: 0 additions & 3 deletions src/tenacity_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,3 @@

/* We're using cygwin */
#cmakedefine __CYGWIN__ 1

/* Use the Aqua theme on Mac */
#cmakedefine USE_AQUA_THEME 1
3 changes: 0 additions & 3 deletions src/toolbars/ControlToolBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
52 changes: 8 additions & 44 deletions src/toolbars/ToolBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/toolbars/ToolBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ class ToolDock;

class ToolBarResizer;

#ifdef __WXMAC__
#define USE_AQUA_THEME 1
#endif

////////////////////////////////////////////////////////////
/// class ToolBar
////////////////////////////////////////////////////////////
Expand Down
3 changes: 0 additions & 3 deletions src/widgets/MeterPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
//{
Expand All @@ -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)
Expand Down

0 comments on commit fab958c

Please sign in to comment.