Use wxSystemAppearance::IsDark() to check for dark mode in wxOSX
This should be more reliable than simply checking the red component of the default window background colour.
This commit is contained in:
@@ -173,11 +173,9 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win,
|
|||||||
wxHeaderSortIconType sortArrow,
|
wxHeaderSortIconType sortArrow,
|
||||||
wxHeaderButtonParams* params )
|
wxHeaderButtonParams* params )
|
||||||
{
|
{
|
||||||
if ( WX_IS_MACOS_AVAILABLE(10, 14) )
|
if ( wxSystemSettings::GetAppearance().IsDark() )
|
||||||
{
|
|
||||||
if ( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW).Red() < 128 )
|
|
||||||
return wxRendererNative::GetGeneric().DrawHeaderButton(win, dc, rect, flags, sortArrow, params);
|
return wxRendererNative::GetGeneric().DrawHeaderButton(win, dc, rect, flags, sortArrow, params);
|
||||||
}
|
|
||||||
const wxCoord x = rect.x;
|
const wxCoord x = rect.x;
|
||||||
const wxCoord y = rect.y;
|
const wxCoord y = rect.y;
|
||||||
const wxCoord w = rect.width;
|
const wxCoord w = rect.width;
|
||||||
@@ -391,13 +389,7 @@ void wxRendererMac::DrawSplitterSash( wxWindow *win,
|
|||||||
|
|
||||||
if ( win->HasFlag(wxSP_3DSASH) )
|
if ( win->HasFlag(wxSP_3DSASH) )
|
||||||
{
|
{
|
||||||
bool doDraw;
|
if ( !wxSystemSettings::GetAppearance().IsDark() )
|
||||||
if ( WX_IS_MACOS_AVAILABLE(10, 14) )
|
|
||||||
doDraw = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW).Red() > 128;
|
|
||||||
else
|
|
||||||
doDraw = true;
|
|
||||||
|
|
||||||
if ( doDraw )
|
|
||||||
{
|
{
|
||||||
HIThemeSplitterDrawInfo drawInfo;
|
HIThemeSplitterDrawInfo drawInfo;
|
||||||
drawInfo.version = 0;
|
drawInfo.version = 0;
|
||||||
|
@@ -88,7 +88,7 @@ void wxStatusBarMac::InitColours()
|
|||||||
m_textActive = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT);
|
m_textActive = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT);
|
||||||
m_textInactive = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
|
m_textInactive = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
|
||||||
|
|
||||||
if ( bg.Red() < 128 )
|
if ( wxSystemSettings::GetAppearance().IsDark() )
|
||||||
{
|
{
|
||||||
// dark mode appearance
|
// dark mode appearance
|
||||||
m_textActive = wxColour(0xB0, 0xB0, 0xB0);
|
m_textActive = wxColour(0xB0, 0xB0, 0xB0);
|
||||||
|
Reference in New Issue
Block a user