diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2012-12-07 16:22:48 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-02-27 23:55:49 +0100 |
commit | b1cfa62ff45cc4b5c035fc5dbe49461e9fe6052a (patch) | |
tree | 1a8a4fa2be341e7ef7bfc7f6bbfe2d615068e505 /src/plugins | |
parent | 0d9a50380c2d3ecc33f632f9f0e158c3a8cd2099 (diff) |
iOS: let fullscreen geometry take orientation into account
Since UIScreen is orientation agnostic, we need to look at the
view of the top level view controller instead to determine
available geometry.
Change-Id: I3789ab7972a9970e46fbc8af81f2b7199e5ca5d1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 2b97695a10..266000d2de 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -232,10 +232,13 @@ void QIOSWindow::setWindowState(Qt::WindowState state) switch (state) { case Qt::WindowMaximized: - case Qt::WindowFullScreen: - m_view.frame = toCGRect(QRect(QPoint(0, 0), window()->screen()->availableSize())); + case Qt::WindowFullScreen: { + // Since UIScreen does not take orientation into account when + // reporting geometry, we need to look at the top view instead: + CGSize fullscreenSize = m_view.window.rootViewController.view.bounds.size; + m_view.frame = CGRectMake(0, 0, fullscreenSize.width, fullscreenSize.height); m_view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - break; + break; } default: m_view.frame = toCGRect(geometry()); m_view.autoresizingMask = UIViewAutoresizingNone; |