Fix generic wxSearchCtrl for system colour change (PR #26704)

4 views
Skip to first unread message

Steve Cornett

unread,
1:57 PM (9 hours ago) 1:57 PM
to wx-...@googlegroups.com, Subscribed

Update the background colour of the generic wxSearchCtrl upon wxSysColourChangedEvent. The strategy is to move the colour setting code into a new function UpdateColours(), and call that during both creation and upon colour change event.

The text control background colour is set explicitly rather than relying on the text control to respond to colour change events itself. I made this decision due to 9b97d3a which indicates Qt requires the explicit colour. I tested with Qt but could not confirm this requirement. Nevertheless, it seems less risky to continue setting the colour explicitly.

The method of setting the wxSearchCtrl colour is changed from calling SetBackgroundColour() to assigning m_backgroundColour unless m_hasBgCol is set, to avoid overwriting a user-set colour.

In RecalcBitmaps(), remove the checks that avoided rendering the bitmaps if their size had not changed. The bitmaps need to be rendered when the light/dark mode changes.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26704

Commit Summary

  • a9cbcad Fix generic wxSearchCtrl for system colour change

File Changes

(2 files)

Patch Links:


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.Message ID: <wxWidgets/wxWidgets/pull/26704@github.com>

Reply all
Reply to author
Forward
0 new messages