diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-11-20 17:33:48 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-21 11:01:33 +0100 |
commit | c62efb52b538063ab561cd5c8fceab206de7c427 (patch) | |
tree | f337b30df021e180b2b2974988aeb8c4e7788655 /src/plugins/platforms/ios/qioswindow.mm | |
parent | e6d13c7f00aeeb1e52245f4f8350a665a2d50e67 (diff) |
iOS: Use custom method to lay out windows instead of resizeMaximizedWindows()
Since we guard against overriding the geometry in setGeometry() when a window
has a window state, we need to use a custom method to lay out windows that
calls applyGeometry() instead.
Change-Id: I6508e6aac6746c024a6172f709b8339b35b40994
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.mm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 2413a45e11..52851439b1 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -435,6 +435,11 @@ void QIOSWindow::setGeometry(const QRect &rect) if (window()->windowState() & (Qt::WindowMaximized | Qt::WindowFullScreen)) return; + applyGeometry(rect); +} + +void QIOSWindow::applyGeometry(const QRect &rect) +{ // Since we don't support transformations on the UIView, we can set the frame // directly and let UIKit deal with translating that into bounds and center. // Changing the size of the view will end up in a call to -[QUIView layoutSubviews] @@ -448,21 +453,18 @@ void QIOSWindow::setWindowState(Qt::WindowState state) // Perhaps setting QWindow to maximized should also mean that we'll show // the statusbar, and vice versa for fullscreen? - if (state != Qt::WindowNoState) - m_normalGeometry = geometry(); - switch (state) { case Qt::WindowNoState: - setGeometry(m_normalGeometry); + applyGeometry(m_normalGeometry); break; case Qt::WindowMaximized: - setGeometry(screen()->availableGeometry()); + applyGeometry(screen()->availableGeometry()); break; case Qt::WindowFullScreen: - setGeometry(screen()->geometry()); + applyGeometry(screen()->geometry()); break; case Qt::WindowMinimized: - setGeometry(QRect()); + applyGeometry(QRect()); break; case Qt::WindowActive: Q_UNREACHABLE(); |