summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosscreen.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-09-26 15:06:46 +0200
committerTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-10-02 13:58:01 +0200
commit231a4a11011f9feb35b1eb41846f09d12b79e1ae (patch)
treebcd32c22cedb2eed3f324973c29fd00583d38c0b /src/plugins/platforms/ios/qiosscreen.mm
parentc027175021e0d8b0d1b66cda4667c73cae5e2941 (diff)
iOS: Move statusbar visibility handling to QIOSViewController
It doesn't belong in QIOScreen, and simplifies the flow when changing the focus window or the window state of the focus window. Both will result in calling updateProperties on the view-controller, which will re-configure the statusbar visibility and hide/show it as appropriate, before triggering a re-layout of its own view, which will in turn trigger an update of the screen properties based on the new statusbar state, before re-layouting of QWindow based on the new screen state. Change-Id: I89077a3fb5f843949ce833e4e727d2c753ea2eb6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiosscreen.mm')
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index 266e6848e2..d8a49eace6 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -225,8 +225,6 @@ QIOSScreen::QIOSScreen(UIScreen *screen)
}
}
- connect(qGuiApp, &QGuiApplication::focusWindowChanged, this, &QIOSScreen::updateStatusBarVisibility);
-
updateProperties();
}
@@ -254,44 +252,6 @@ void QIOSScreen::updateProperties()
}
}
-void QIOSScreen::updateStatusBarVisibility()
-{
- if (!isQtApplication())
- return;
-
- QWindow *focusWindow = QGuiApplication::focusWindow();
-
- // If we don't have a focus window we leave the status
- // bar as is, so that the user can activate a new window
- // with the same window state without the status bar jumping
- // back and forth.
- if (!focusWindow)
- return;
-
- UIView *view = reinterpret_cast<UIView *>(focusWindow->handle()->winId());
- QIOSViewController *viewController = static_cast<QIOSViewController *>(view.viewController);
-
- bool currentStatusBarVisibility = [UIApplication sharedApplication].statusBarHidden;
- if (viewController.prefersStatusBarHidden == currentStatusBarVisibility)
- return;
-
-#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_7_0)
- if (QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_7_0) {
- [viewController setNeedsStatusBarAppearanceUpdate];
- dispatch_async(dispatch_get_main_queue(), ^{
- updateProperties();
- });
- } else
-#endif
- {
- [[UIApplication sharedApplication]
- setStatusBarHidden:[viewController prefersStatusBarHidden]
- withAnimation:UIStatusBarAnimationNone];
-
- updateProperties();
- }
-}
-
QRect QIOSScreen::geometry() const
{
return m_geometry;