This is a proposed alternative to #26635. This is starkly minimalistic while retaining the two essential ideas proposed by @memoarfaa.
The flicker problem is solved by using a clipping region when calling MSWDefWindowProc() to prevent drawing the light mode border.
The dark mode border is drawn explicitly instead of using UxTheme so that it looks good on older versions of windows. This is extremely simple for now. The border is always a 1-pixel thick gray rectangle, regardless of border style. The color is hard-coded to what I see with wxBORDER_SIMPLE/WS_BORDER. A possible improvement is to get the color by querying a theme class with TMT_BORDERCOLOR. I experimented with this but was not able to get a satisfactory color. Other possible improvements might be rounded corners or an indication of focus for some controls. For example, in light mode, the edit control shows a blue line at the bottom when focused.
https://github.com/wxWidgets/wxWidgets/pull/26646
(1 file)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@stevecor pushed 1 commit.
—
View it on GitHub or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@vadz approved this pull request.
Thanks, I really like how simple this is, so I'm going to merge it and while we should improve it later, this should be an improvement right now.
> -
- // The part and state values match for the themes we use.
- static_assert((int)EP_EDITTEXT == (int)LVP_LISTITEM, "parts differ?");
- static_assert((int)EP_EDITTEXT == (int)BP_PUSHBUTTON, "parts differ?");
- static_assert((int)ETS_NORMAL == (int)LISS_NORMAL, "states differ?");
- static_assert((int)ETS_NORMAL == (int)PBS_NORMAL, "states differ?");
-
- // Make sure the background is in a proper state
- if (::IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
+ if ( wxMSWDarkMode::IsActive() )
+ {
+ // There does not seem to be a theme class that draws a good
+ // border on all supported versions of Windows. Manually draw a
+ // 1-pixel thick border. Use the observed colour of the simple
+ // border, WS_BORDER.
+ AutoHBRUSH brushBorder(0x646464);
A bit strange that it's not any of the colours returned by wxDarkModeSettings::GetColour(). Maybe we should map wxSYS_COLOUR_INACTIVEBORDER to it, for example?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Just FYI: I'm applying this as 2 commits in order not to have the "typo fix" as a separate commit. And thanks for the commits message bodies!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()