mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 08:53:06 +08:00
Preserve wxNotebook custom colours upon dark mode switch
This commit is contained in:
+11
-10
@@ -271,8 +271,9 @@ void wxNotebook::MSWSetDarkOrLightMode(SetMode setmode)
|
||||
{
|
||||
wxNotebookBase::MSWSetDarkOrLightMode(setmode);
|
||||
|
||||
// Background must always be set.
|
||||
SetBackgroundColour(GetDefaultAttributes().colBg);
|
||||
// Background must always be set, unless there is a custom colour.
|
||||
if ( !m_hasBgCol )
|
||||
m_backgroundColour = GetDefaultAttributes().colBg;
|
||||
}
|
||||
|
||||
int wxNotebook::MSWGetToolTipMessage() const
|
||||
@@ -1344,14 +1345,6 @@ void wxNotebook::MSWNotebookPaint()
|
||||
|
||||
void wxNotebook::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
// We can rely on the default implementation if we don't have a custom
|
||||
// background colour (note that it is always set when using dark mode).
|
||||
if ( !m_hasBgCol )
|
||||
{
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( wxMSWDarkMode::IsActive() )
|
||||
{
|
||||
// We can't use default painting in dark mode, it just doesn't work
|
||||
@@ -1360,6 +1353,14 @@ void wxNotebook::OnPaint(wxPaintEvent& event)
|
||||
return;
|
||||
}
|
||||
|
||||
// We can rely on the default implementation if we don't have a custom
|
||||
// background colour.
|
||||
if ( !m_hasBgCol )
|
||||
{
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
wxPaintDC dc(this);
|
||||
|
||||
RECT rc;
|
||||
|
||||
Reference in New Issue
Block a user