summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorDoris Verria <doris.verria@qt.io>2022-09-29 12:38:33 +0200
committerDoris Verria <doris.verria@qt.io>2022-09-29 17:09:08 +0200
commit26b3a466d7d189cc09f171f2066512feee3737c8 (patch)
tree420b41e1bbbc6634268e312e43924f4965934163 /src/plugins/platforms
parent11be4c5ce801c870081387e40dfbd813e299f34d (diff)
QIOSTheme: Get the appearance mode from the UIWindow's traitCollection
We were getting the appearance (light/dark) through the traitCollection of the UIWindow's rootViewController. It looks like this does not report the correct value when the appearance changes through System Settings. If we get it directly from the UIWindow's traitCollection property, it works as it should. Also, in traitCollectionDidChange: we are checking for changes in the traitCollection of the UIWindow's, not of the viewController's. Change-Id: I437e6922b268fd0069d80557a1034391ed52644b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/ios/qiostheme.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm
index 51d88710bd..62ba4d669b 100644
--- a/src/plugins/platforms/ios/qiostheme.mm
+++ b/src/plugins/platforms/ios/qiostheme.mm
@@ -135,7 +135,7 @@ QVariant QIOSTheme::themeHint(ThemeHint hint) const
Qt::Appearance QIOSTheme::appearance() const
{
if (UIWindow *window = qt_apple_sharedApplication().windows.lastObject) {
- return window.rootViewController.traitCollection.userInterfaceStyle
+ return window.traitCollection.userInterfaceStyle
== UIUserInterfaceStyleDark
? Qt::Appearance::Dark
: Qt::Appearance::Light;