diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2021-06-29 11:58:04 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2021-09-17 13:31:59 +0200 |
commit | 2248487c6ca9d5459c70a16868d5aeee07d96157 (patch) | |
tree | d0e2c0dcb5338f58668be422bfc833215ee05323 /src/gui/kernel/qplatformtheme.h | |
parent | b6200de5d0894e63d58848e291f52a6ff98f3d9a (diff) |
Add QPlatformTheme::Appearance for detecting light/dark modes
And implement it on Windows and macOS.
Fixes: QTBUG-83908
Fixes: QTBUG-94859
Change-Id: I7b0c062adf5d4dbaefa64c862ab8ab1348809d71
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel/qplatformtheme.h')
-rw-r--r-- | src/gui/kernel/qplatformtheme.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 0b6c0254f0..011f8d548c 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -128,6 +128,12 @@ public: MessageDialog }; + enum class Appearance { + Unknown = 0x0000, + Light = 0x0001, + Dark = 0x0002 + }; + enum Palette { SystemPalette, ToolTipPalette, @@ -299,6 +305,8 @@ public: virtual QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const; #endif + virtual Appearance appearance() const; + virtual const QPalette *palette(Palette type = SystemPalette) const; virtual const QFont *font(Font type = SystemFont) const; |