Workaround to fix text colour not changing in status bar#635
Workaround to fix text colour not changing in status bar#635Micheus wants to merge 2 commits intodgud:masterfrom
Conversation
It was noticed that the text color in the status bar doesn't change according to the theme settings. Looking for info I found that it's an know issue in wxWidgets which setting the color of native controls is not always possible. Considering we use the wxFLAT style, drawing the status bar ourselves is the easiest and most effective way to work around this issue. I included a grip icon similar to the Windows version, since no system resource is available for use (as with other system icons). NOTE: Fixed a theme issue that was preventing the status bar text from using its setting in the theme color. Thanks to Nova711 (on Discord).
907f492 to
2e63145
Compare
|
Same here I don't know how this looks on mac, but have no mac to test it with :-/ Ping @bjorng |
|
Issues
The PR title says "fix text colour not changing" but custom_draw never calls wxDC:setTextForeground/2. The text will
The fix needs a line like: SFG = wings_color:rgb4bv(wings_pref:get_value(info_line_text)), before the drawText calls. Without this, the PR only fixes the background, not the text colour.
wxDC:drawText uses the DC's current font, which defaults to the system font. The original wxStatusBar may use a wxDC:setFont(DC, wxWindow:getFont(Obj)), to inherit the status bar's font. Otherwise text may render in a different size/face than expected.
DC = case os:type() of This actually works because BufferedDC is bound to none in the non-Windows branch and that branch of the cleanup A cleaner pattern (used elsewhere in Wings, e.g. wings_help.erl:464): DC = case os:type() of Actually, looking at wings_help.erl and wings_image_viewer.erl, they all use wxPaintDC:destroy on the typeCast'd DC.
The resize grip (bottom-right corner dots) is drawn unconditionally. On macOS, the native status bar grip looks case os:type() of |


It was noticed that the text color in the status bar doesn't change according
to the theme settings. Looking for info I found that it's an know issue in
wxWidgets which setting the color of native controls is not always possible.
Considering we use the wxFLAT style, drawing the status bar ourselves is the
easiest and most effective way to work around this issue. I included a grip
icon similar to the Windows version, since no system resource is available
for use (as with other system icons).
NOTE:
Fixed a theme issue that was preventing the status bar text from using
its setting in the theme color. Thanks to Nova711 (at Discord).