From 3241f37711bd35988c7a21cc8a4833ec2fa3132d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 9 Nov 2012 17:20:47 +0100 Subject: 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 --- src/plugins/platforms/ios/qioswindow.mm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/plugins/platforms/ios/qioswindow.mm') 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; -- cgit v1.2.3