diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-12-07 17:37:09 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-12-08 17:56:48 +0100 |
commit | a2518b4140ed88a674bf4a4fcf4576e35c698bb9 (patch) | |
tree | 2efe09a5f39ebef0298ca8fb171dc2c8c83f21b4 /src/gui/kernel/qguiapplication_p.h | |
parent | c62c2aac752c6b63d5afd2f7a10dd9f43c99ae7b (diff) |
Overwrite dark system palette in Vista style
The Vista style uses system assets for controls, and those are never
dark. Because of that we cannot support dark appearance with that style,
and applications using the Vista style should always use the light
system palette. Override QStyle::polish(QPalette &) in the vista style
to do that.
To make that palette available, move the code reading the light palette
into QWindowsApplication, and call that method from both the platform
theme (if the system is running in light mode) and from the Vista style
(only if the system is running in dark mode).
If the system is dark mode and another style is used (e.g. Fusion, which
works well with a dark palette), then the palette returned by the
platform theme gets used without any modifications.
This requires duplicating some small inline helper functions in
QWindowsTheme and QWindowsApplication. We can clean this up once the
implementation is complete for both Qt Widgets and Qt Quick.
Change-Id: Ia13f59a2d8414642603f9708926718daf9e8954d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Diffstat (limited to 'src/gui/kernel/qguiapplication_p.h')
-rw-r--r-- | src/gui/kernel/qguiapplication_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 9d8e292445..46bc504f5f 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -396,6 +396,8 @@ struct Q_GUI_EXPORT QWindowsApplication virtual QVariant gpu() const = 0; // internal, used by qtdiag virtual QVariant gpuList() const = 0; + + virtual void lightSystemPalette(QPalette &pal) const = 0; }; #endif // Q_OS_WIN |