mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-10-06 07:00:16 +08:00
Fix wxStaticBox for dark mode with double buffering
Set custom painting mode for dark mode in MSWSetDarkOrLightMode() because custom painting mode is not set in Create() when double buffering. Fixes #27004. Closes #27007.
This commit is contained in:
committed by
Vadim Zeitlin
parent
8eea7bebf9
commit
e9d032d517
@@ -78,6 +78,8 @@ public:
|
||||
protected:
|
||||
virtual wxWindowList GetCompositeWindowParts() const override;
|
||||
|
||||
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
|
||||
|
||||
// return the region with all the windows inside this static box excluded
|
||||
WXHRGN MSWGetRegionWithoutChildren();
|
||||
|
||||
|
||||
@@ -95,6 +95,19 @@ bool wxStaticBox::Create(wxWindow *parent,
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxStaticBox::MSWSetDarkOrLightMode(SetMode setmode)
|
||||
{
|
||||
wxStaticBoxBase::MSWSetDarkOrLightMode(setmode);
|
||||
|
||||
// Set custom painting because the native control does not support dark mode.
|
||||
//
|
||||
// Note that it's not useful to check if we're using dark mode now because
|
||||
// we must either be starting to use it now or had been using it at some
|
||||
// point for this function to be called and once custom painting is
|
||||
// enabled, calling this function doesn't do anything anyhow.
|
||||
UseCustomPaint();
|
||||
}
|
||||
|
||||
bool wxStaticBox::ShouldUseCustomPaint() const
|
||||
{
|
||||
// When not using double buffering, we paint the box ourselves by default
|
||||
|
||||
Reference in New Issue
Block a user