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>
bb10
Richard Moe Gustavsen 2012-12-07 16:22:48 +01:00 committed by Tor Arne Vestbø
parent 0d9a50380c
commit b1cfa62ff4
1 changed files with 6 additions and 3 deletions

View File

@ -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;