Disable AUI themes when using dark mode under MSW

There doesn't seem to be any way to use the appropriate colours via
themes API in the dark mode, so just disable using it and draw
everything ourselves when it's on.
This commit is contained in:
Vadim Zeitlin 2022-12-28 00:17:39 +00:00
parent 79b8639a32
commit 521e29de7b
2 changed files with 5 additions and 2 deletions

View file

@ -22,10 +22,12 @@
#include "wx/aui/framemanager.h"
#include "wx/msw/uxtheme.h"
#include "wx/msw/private.h"
#include "wx/msw/private/darkmode.h"
wxAuiMSWToolBarArt::wxAuiMSWToolBarArt()
{
if ( wxUxThemeIsActive() )
// Theme colours don't work in dark theme, so don't use them in this case.
if ( wxUxThemeIsActive() && !wxMSWDarkMode::IsActive() )
{
m_themed = true;

View file

@ -20,6 +20,7 @@
#include "wx/aui/auibook.h"
#include "wx/msw/uxtheme.h"
#include "wx/msw/private.h"
#include "wx/msw/private/darkmode.h"
#include "wx/renderer.h"
wxAuiMSWTabArt::wxAuiMSWTabArt()
@ -27,7 +28,7 @@ wxAuiMSWTabArt::wxAuiMSWTabArt()
m_closeBtnSize = wxDefaultSize;
m_maxTabHeight = 0;
m_themed = wxUxThemeIsActive();
m_themed = wxUxThemeIsActive() && !wxMSWDarkMode::IsActive();
}
wxAuiMSWTabArt::~wxAuiMSWTabArt()