From 355bfe158716ba28719940625666f7df1810c16f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 14 Dec 2022 12:57:40 +0000 Subject: [PATCH] Blind attempt to fix MSW rendering bug. --- common/widgets/split_button.cpp | 2 ++ common/widgets/std_bitmap_button.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/widgets/split_button.cpp b/common/widgets/split_button.cpp index 680d6aa292..7c3e07d37a 100644 --- a/common/widgets/split_button.cpp +++ b/common/widgets/split_button.cpp @@ -217,6 +217,8 @@ void SPLIT_BUTTON::OnPaint( wxPaintEvent& WXUNUSED( aEvent ) ) // system colours return the right values, nor does wxRendererNative draw // the borders correctly. So we add some empirically chosen hacks here. + // NOTE: KEEP THESE HACKS IN SYNC WITH STD_BITMAP_BUTTON + wxColor fg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT ); wxColor bg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); diff --git a/common/widgets/std_bitmap_button.cpp b/common/widgets/std_bitmap_button.cpp index 420b3d7d2c..5184666ed2 100644 --- a/common/widgets/std_bitmap_button.cpp +++ b/common/widgets/std_bitmap_button.cpp @@ -147,6 +147,8 @@ void STD_BITMAP_BUTTON::OnPaint( wxPaintEvent& WXUNUSED( aEvent ) ) // system colours return the right values, nor does wxRendererNative draw // the borders correctly. So we add some empirically chosen hacks here. + // NOTE: KEEP THESE HACKS IN SYNC WITH SPLIT_BUTTON + wxColor fg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT ); wxColor bg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); @@ -181,7 +183,7 @@ void STD_BITMAP_BUTTON::OnPaint( wxPaintEvent& WXUNUSED( aEvent ) ) // wxRendereNative doesn't handle dark mode on OSX. drawBackground( r1 ); #else - r1.width += 2; + r1.width += 1; wxRendererNative::Get().DrawPushButton( this, dc, r1, m_stateButton ); #endif