Avoid changing checkbox background in wxGrid under non-MSW

Doing this makes the checkbox unusable with the default GTK 3 theme as
the default grid background colour (white) is the same as the colour of
the check mark -- so changing the checkbox background to it makes it
invisible.

Work around this by adding a new SetTransparentPartColour() method that
can be used by wxGrid (and, in the future, user code if we decide that
this is really the best solution to this problem that we can provide) to
make the checkbox blend in with its background without actually changing
its appearance.
This commit is contained in:
Vadim Zeitlin
2019-11-28 02:06:45 +01:00
parent e2bb8b05bf
commit 2eb312b5f9
3 changed files with 34 additions and 1 deletions

View File

@@ -99,6 +99,11 @@ public:
virtual bool HasTransparentBackground() wxOVERRIDE { return true; }
// This semi-private function is currently used to allow wxMSW checkbox to
// blend in with its parent background colour without changing the
// background colour of the checkbox itself under the other platforms.
virtual void SetTransparentPartColour(const wxColour& WXUNUSED(col)) { }
// wxCheckBox-specific processing after processing the update event
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) wxOVERRIDE
{