summaryrefslogtreecommitdiff
path: root/src/controls/ApplicationWindow.qml
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-03-20 16:57:09 +0100
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-03-27 14:18:55 +0000
commit10a57f37d0f03e8642a7c92dcacf287c95777342 (patch)
tree123950f0d8c555bd44886fe73b74b0eb8d90e785 /src/controls/ApplicationWindow.qml
parent1c0deaf9805903f4f33ff09056b3153fd92b5618 (diff)
downloadqtquickcontrols-10a57f37d0f03e8642a7c92dcacf287c95777342.tar.gz
iOS: Make ApplicationWindow fill entire screen, including under statusbar
We take advantage of the new Qt::WindowFlag that asks the OS to maximize the window using as much as possible of the available screen geometry, and then make sure that the contentItem is shifted accordingly so that it doesn't end up under the statusbar. This allow setting a custom background image/color on the application window, or adding toolbars or menu bars that underlay the iOS system status bar. Change-Id: I6efab2aced7efd274a65f2524ae8c270d20de187 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Diffstat (limited to 'src/controls/ApplicationWindow.qml')
-rw-r--r--src/controls/ApplicationWindow.qml24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml
index 542cfe4e..2f019d31 100644
--- a/src/controls/ApplicationWindow.qml
+++ b/src/controls/ApplicationWindow.qml
@@ -198,11 +198,19 @@ Window {
/*! \internal */
default property alias data: contentArea.data
- flags: Qt.Window | Qt.WindowFullscreenButtonHint |
- Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint |
- Qt.WindowCloseButtonHint | Qt.WindowFullscreenButtonHint
- // QTBUG-35049: Windows is removing features we didn't ask for, even though Qt::CustomizeWindowHint is not set
- // Otherwise Qt.Window | Qt.WindowFullscreenButtonHint would be enough
+ flags: {
+ var flags = Qt.Window | Qt.WindowFullscreenButtonHint;
+
+ // QTBUG-35049: Windows is removing features we didn't ask for, even though Qt::CustomizeWindowHint is not set
+ // Otherwise Qt.Window | Qt.WindowFullscreenButtonHint would be enough
+ flags |= Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint |
+ Qt.WindowCloseButtonHint | Qt.WindowFullscreenButtonHint
+
+ if (Settings.styleName === "iOS")
+ flags |= Qt.MaximizeUsingFullscreenGeometryHint;
+
+ return flags;
+ }
Loader {
id: panelLoader
@@ -235,8 +243,12 @@ Window {
ContentItem {
id: contentArea
- anchors.fill: parent
parent: __panel.contentArea
+ anchors {
+ fill: parent
+ topMargin: systemPadding.top; bottomMargin: systemPadding.bottom
+ leftMargin: systemPadding.left; rightMargin: systemPadding.right
+ }
}
}
}