diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2018-06-15 23:18:49 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-08-09 10:27:24 +0000 |
commit | da62e76eacd538eb61e188bc53e24cd1aaf01e49 (patch) | |
tree | 268962f5fc927446380319986f44efd23cb76a7f /src/plugins/platforms/cocoa/qcocoatheme.h | |
parent | a09c8b0ee6ddd13251ee1335ede73fd66e007a35 (diff) |
Cocoa: Update palette after accent color or appearance changes
This updates the UI after the accent color or NSApp's effective
appearance have changed. For the accent color, we listen to
NSSystemColorsDidChangeNotification. For the effective appearance
changes, we do KVO on NSApp.effectiveAppearance.
Both changes will trigger rebuilding the system palettes followed
by a ThemeChangeEvent in the window system interface layer.
Task-number: QTBUG-68891
Change-Id: Iab1ec874e05f1f6d54cd60217c273e0f8ffbf49e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoatheme.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoatheme.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.h b/src/plugins/platforms/cocoa/qcocoatheme.h index 69eaf8db56..c42fa7d2e8 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.h +++ b/src/plugins/platforms/cocoa/qcocoatheme.h @@ -43,7 +43,7 @@ #include <QtCore/QHash> #include <qpa/qplatformtheme.h> -Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaThemeNotificationReceiver)); +Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaThemeAppAppearanceObserver)); QT_BEGIN_NAMESPACE @@ -78,11 +78,13 @@ public: static const char *name; + void handleSystemThemeChange(); + private: mutable QPalette *m_systemPalette; mutable QHash<QPlatformTheme::Palette, QPalette*> m_palettes; mutable QHash<QPlatformTheme::Font, QFont*> m_fonts; - mutable QT_MANGLE_NAMESPACE(QCocoaThemeNotificationReceiver) *m_notificationReceiver; + QT_MANGLE_NAMESPACE(QCocoaThemeAppAppearanceObserver) *m_appearanceObserver; }; QT_END_NAMESPACE |