summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qioswindow.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2012-11-09 17:20:47 +0100
committerTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-02-27 23:55:42 +0100
commit3241f37711bd35988c7a21cc8a4833ec2fa3132d (patch)
tree1f428d5f38a5f1b50fa95481fa6bb3f0269d60ce /src/plugins/platforms/ios/qioswindow.mm
parente123056c47e33759e740ea2e25771e0cc1899c13 (diff)
iOS: Implement QPlatformWindow::setWindowState()
In both maximized and fullscreen modes we assume that we can use the availableGeometry() of the QScreen, but of course this depends on us showing or hiding the statusbar first, as well as QScreen actually returning the right availableGeometry when the statusbar is shown. The latter is not the case right now, as we initialize QScreen before UIApplication has been set up and UIScreen has had a chance to init itself based on the precense of a statusbar or not. Change-Id: Id44dee3550f7135ffe2852b377bb6c7b6d522d68 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios/qioswindow.mm')
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm
index feabaeb47a..cccd5ab133 100644
--- a/src/plugins/platforms/ios/qioswindow.mm
+++ b/src/plugins/platforms/ios/qioswindow.mm
@@ -203,6 +203,8 @@ QIOSWindow::QIOSWindow(QWindow *window)
if ([uiApplication.delegate isMemberOfClass:[QIOSApplicationDelegate class]])
[uiApplication.delegate.window.rootViewController.view addSubview:m_view];
}
+
+ setWindowState(window->windowState());
}
QIOSWindow::~QIOSWindow()
@@ -235,6 +237,22 @@ void QIOSWindow::updateGeometry(const QRect &rect)
QWindowSystemInterface::handleGeometryChange(window(), rect);
}
+void QIOSWindow::setWindowState(Qt::WindowState state)
+{
+ // FIXME: Figure out where or how we should disable/enable the statusbar.
+ // Perhaps setting QWindow to maximized should also mean that we'll show
+ // the statusbar, and vice versa for fullscreen?
+
+ switch (state) {
+ case Qt::WindowMaximized:
+ case Qt::WindowFullScreen:
+ setGeometry(QRect(QPoint(0, 0), window()->screen()->availableSize()));
+ break;
+ default:
+ break;
+ }
+}
+
GLuint QIOSWindow::framebufferObject(const QIOSContext &context) const
{
static GLuint framebuffer = 0;