Author Topic: AUI text is unreadable in high contrast mode  (Read 3068 times)

Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
AUI text is unreadable in high contrast mode
« on: April 15, 2020, 12:20:07 pm »
Hello,
AUI text is unreadable in high contrast mode. I fixed it in https://github.com/wxWidgets/wxWidgets/commit/697bd0744159e8c0ded7fb4174eecbfa41700e7c. Could you please consider applying this patch to wxWidgets when you will do the next release?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1632
Re: AUI text is unreadable in high contrast mode
« Reply #1 on: April 15, 2020, 02:01:07 pm »
I have been looking the patch for src/aui/barartmsw.cpp, and the text color for disabled buttons is still hardcoded in two methods (DrawButton and DrawDropDownButton). Also, for disabled buttons you set the color twice. I think

Code
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_CAPTIONTEXT));
if ( item.GetState() & wxAUI_BUTTON_STATE_DISABLED )
    dc.SetTextForeground(DISABLED_TEXT_COLOR);

should be

Code
if ( item.GetState() & wxAUI_BUTTON_STATE_DISABLED )
    dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_INACTIVECAPTIONTEXT));
else
    dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_CAPTIONTEXT));

and this part can be removed

Code
static const unsigned char
DISABLED_TEXT_GREY_HUE = wxColour::AlphaBlend(0, 255, 0.4);
const wxColour DISABLED_TEXT_COLOR(DISABLED_TEXT_GREY_HUE,
    DISABLED_TEXT_GREY_HUE,
    DISABLED_TEXT_GREY_HUE);

Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: AUI text is unreadable in high contrast mode
« Reply #2 on: April 15, 2020, 02:03:12 pm »
Thanks. I will look at this.

Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: AUI text is unreadable in high contrast mode
« Reply #3 on: April 15, 2020, 03:33:44 pm »
I would actually use `wxSYS_COLOUR_GRAYTEXT` instead of `wxSYS_COLOUR_INACTIVECAPTIONTEXT`.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: AUI text is unreadable in high contrast mode
« Reply #4 on: April 15, 2020, 10:07:46 pm »
Could you please consider applying this patch to wxWidgets when you will do the next release?
Only if they make an actual release. If not we'll pick only things which prevent crashes...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]