Enable dark mode for MacOS
This commit is contained in:
parent
f00cee438f
commit
64d35ecebc
|
@ -159,8 +159,6 @@ static const wxChar HotkeysDumper[] = wxT( "HotkeysDumper" );
|
||||||
|
|
||||||
static const wxChar DrawBoundingBoxes[] = wxT( "DrawBoundingBoxes" );
|
static const wxChar DrawBoundingBoxes[] = wxT( "DrawBoundingBoxes" );
|
||||||
|
|
||||||
static const wxChar AllowDarkMode[] = wxT( "AllowDarkMode" );
|
|
||||||
|
|
||||||
static const wxChar ShowPcbnewExportNetlist[] = wxT( "ShowPcbnewExportNetlist" );
|
static const wxChar ShowPcbnewExportNetlist[] = wxT( "ShowPcbnewExportNetlist" );
|
||||||
|
|
||||||
} // namespace KEYS
|
} // namespace KEYS
|
||||||
|
@ -264,7 +262,6 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||||
m_SmallDrillMarkSize = 0.35;
|
m_SmallDrillMarkSize = 0.35;
|
||||||
m_HotkeysDumper = false;
|
m_HotkeysDumper = false;
|
||||||
m_DrawBoundingBoxes = false;
|
m_DrawBoundingBoxes = false;
|
||||||
m_AllowDarkMode = false;
|
|
||||||
m_ShowPcbnewExportNetlist = false;
|
m_ShowPcbnewExportNetlist = false;
|
||||||
|
|
||||||
loadFromConfigFile();
|
loadFromConfigFile();
|
||||||
|
@ -359,15 +356,6 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DrawBoundingBoxes,
|
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DrawBoundingBoxes,
|
||||||
&m_DrawBoundingBoxes, false ) );
|
&m_DrawBoundingBoxes, false ) );
|
||||||
|
|
||||||
#if defined( __WXGTK__ ) || defined( __WXMSW__ )
|
|
||||||
bool defaultDarkMode = true;
|
|
||||||
#else
|
|
||||||
bool defaultDarkMode = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::AllowDarkMode,
|
|
||||||
&m_AllowDarkMode, defaultDarkMode ) );
|
|
||||||
|
|
||||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowPcbnewExportNetlist,
|
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowPcbnewExportNetlist,
|
||||||
&m_ShowPcbnewExportNetlist, false ) );
|
&m_ShowPcbnewExportNetlist, false ) );
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ bool BITMAP_STORE::ThemeChanged()
|
||||||
|
|
||||||
wxString oldTheme = m_theme;
|
wxString oldTheme = m_theme;
|
||||||
|
|
||||||
if( ADVANCED_CFG::GetCfg().m_AllowDarkMode && settings )
|
if( settings )
|
||||||
{
|
{
|
||||||
switch( settings->m_Appearance.icon_theme )
|
switch( settings->m_Appearance.icon_theme )
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,14 +72,6 @@ PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aP
|
||||||
m_antialiasingFallbackLabel->Show( false );
|
m_antialiasingFallbackLabel->Show( false );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( !ADVANCED_CFG::GetCfg().m_AllowDarkMode )
|
|
||||||
{
|
|
||||||
m_rbIconThemeLight->Hide();
|
|
||||||
m_rbIconThemeDark->Hide();
|
|
||||||
m_rbIconThemeAuto->Hide();
|
|
||||||
m_stIconTheme->Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_textEditorBtn->SetBitmap( KiBitmap( BITMAPS::small_folder ) );
|
m_textEditorBtn->SetBitmap( KiBitmap( BITMAPS::small_folder ) );
|
||||||
m_pdfViewerBtn->SetBitmap( KiBitmap( BITMAPS::small_folder ) );
|
m_pdfViewerBtn->SetBitmap( KiBitmap( BITMAPS::small_folder ) );
|
||||||
|
|
||||||
|
|
|
@ -181,11 +181,8 @@ ACTION_TOOLBAR::ACTION_TOOLBAR( EDA_BASE_FRAME* parent, wxWindowID id, const wxP
|
||||||
|
|
||||||
#if !wxCHECK_VERSION( 3, 1, 0 )
|
#if !wxCHECK_VERSION( 3, 1, 0 )
|
||||||
// Custom art provider makes dark mode work on wx < 3.1
|
// Custom art provider makes dark mode work on wx < 3.1
|
||||||
if( ADVANCED_CFG::GetCfg().m_AllowDarkMode )
|
WX_AUI_TOOLBAR_ART* newArt = new WX_AUI_TOOLBAR_ART();
|
||||||
{
|
SetArtProvider( newArt );
|
||||||
WX_AUI_TOOLBAR_ART* newArt = new WX_AUI_TOOLBAR_ART();
|
|
||||||
SetArtProvider( newArt );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Connect( wxEVT_COMMAND_TOOL_CLICKED, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolEvent ),
|
Connect( wxEVT_COMMAND_TOOL_CLICKED, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolEvent ),
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <id.h>
|
#include <id.h>
|
||||||
|
#include <kiplatform/ui.h>
|
||||||
#include <widgets/infobar.h>
|
#include <widgets/infobar.h>
|
||||||
#include "wx/artprov.h"
|
#include "wx/artprov.h"
|
||||||
#include <wx/aui/framemanager.h>
|
#include <wx/aui/framemanager.h>
|
||||||
|
@ -54,7 +55,10 @@ WX_INFOBAR::WX_INFOBAR( wxWindow* aParent, wxAuiManager* aMgr, wxWindowID aWinid
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// wxWidgets hard-codes wxSYS_COLOUR_INFOBK to { 0xFF, 0xFF, 0xD3 } on Mac.
|
// wxWidgets hard-codes wxSYS_COLOUR_INFOBK to { 0xFF, 0xFF, 0xD3 } on Mac.
|
||||||
SetBackgroundColour( wxColour( 255, 249, 189 ) );
|
if( KIPLATFORM::UI::IsDarkTheme() )
|
||||||
|
SetBackgroundColour( wxColour( 28, 27, 20 ) );
|
||||||
|
else
|
||||||
|
SetBackgroundColour( wxColour( 255, 249, 189 ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetShowHideEffects( wxSHOW_EFFECT_ROLL_TO_BOTTOM, wxSHOW_EFFECT_ROLL_TO_TOP );
|
SetShowHideEffects( wxSHOW_EFFECT_ROLL_TO_BOTTOM, wxSHOW_EFFECT_ROLL_TO_TOP );
|
||||||
|
|
|
@ -165,11 +165,6 @@ public:
|
||||||
*/
|
*/
|
||||||
bool m_DrawBoundingBoxes;
|
bool m_DrawBoundingBoxes;
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable detection of dark mode and automatic switch to dark-mode icon theme
|
|
||||||
*/
|
|
||||||
bool m_AllowDarkMode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable exporting board editor netlist to a file for troubleshooting purposes.
|
* Enable exporting board editor netlist to a file for troubleshooting purposes.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
||||||
<key>CSResourcesFileMapped</key> <true/>
|
<key>CSResourcesFileMapped</key> <true/>
|
||||||
<key>LSRequiresCarbon</key> <true/>
|
<key>LSRequiresCarbon</key> <true/>
|
||||||
<key>NSRequiresAquaSystemAppearance</key> <true/>
|
|
||||||
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
||||||
<key>NSHighResolutionCapable</key> <string>True</string>
|
<key>NSHighResolutionCapable</key> <string>True</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
||||||
<key>CSResourcesFileMapped</key> <true/>
|
<key>CSResourcesFileMapped</key> <true/>
|
||||||
<key>LSRequiresCarbon</key> <true/>
|
<key>LSRequiresCarbon</key> <true/>
|
||||||
<key>NSRequiresAquaSystemAppearance</key> <true/>
|
|
||||||
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
||||||
<key>NSHighResolutionCapable</key> <string>True</string>
|
<key>NSHighResolutionCapable</key> <string>True</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
||||||
<key>CSResourcesFileMapped</key> <true/>
|
<key>CSResourcesFileMapped</key> <true/>
|
||||||
<key>LSRequiresCarbon</key> <true/>
|
<key>LSRequiresCarbon</key> <true/>
|
||||||
<key>NSRequiresAquaSystemAppearance</key> <true/>
|
|
||||||
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
||||||
<key>NSHighResolutionCapable</key> <string>True</string>
|
<key>NSHighResolutionCapable</key> <string>True</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
||||||
<key>CSResourcesFileMapped</key> <true/>
|
<key>CSResourcesFileMapped</key> <true/>
|
||||||
<key>LSRequiresCarbon</key> <true/>
|
<key>LSRequiresCarbon</key> <true/>
|
||||||
<key>NSRequiresAquaSystemAppearance</key> <true/>
|
|
||||||
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
||||||
<key>NSHighResolutionCapable</key> <string>True</string>
|
<key>NSHighResolutionCapable</key> <string>True</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
||||||
<key>CSResourcesFileMapped</key> <true/>
|
<key>CSResourcesFileMapped</key> <true/>
|
||||||
<key>LSRequiresCarbon</key> <true/>
|
<key>LSRequiresCarbon</key> <true/>
|
||||||
<key>NSRequiresAquaSystemAppearance</key> <true/>
|
|
||||||
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
||||||
<key>NSHighResolutionCapable</key> <string>True</string>
|
<key>NSHighResolutionCapable</key> <string>True</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
||||||
<key>CSResourcesFileMapped</key> <true/>
|
<key>CSResourcesFileMapped</key> <true/>
|
||||||
<key>LSRequiresCarbon</key> <true/>
|
<key>LSRequiresCarbon</key> <true/>
|
||||||
<key>NSRequiresAquaSystemAppearance</key> <true/>
|
|
||||||
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
||||||
<key>NSHighResolutionCapable</key> <string>True</string>
|
<key>NSHighResolutionCapable</key> <string>True</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
||||||
<key>CSResourcesFileMapped</key> <true/>
|
<key>CSResourcesFileMapped</key> <true/>
|
||||||
<key>LSRequiresCarbon</key> <true/>
|
<key>LSRequiresCarbon</key> <true/>
|
||||||
<key>NSRequiresAquaSystemAppearance</key> <true/>
|
|
||||||
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
|
||||||
<key>NSHighResolutionCapable</key> <string>True</string>
|
<key>NSHighResolutionCapable</key> <string>True</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
Loading…
Reference in New Issue