summaryrefslogtreecommitdiff
path: root/src/controls/MenuBar.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/MenuBar.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/MenuBar.qml')
-rw-r--r--src/controls/MenuBar.qml13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/controls/MenuBar.qml b/src/controls/MenuBar.qml
index 7a92c1ec..f1f702f6 100644
--- a/src/controls/MenuBar.qml
+++ b/src/controls/MenuBar.qml
@@ -132,6 +132,11 @@ MenuBarPrivate {
value: menuMouseArea.z - 1
}
+ ContentItem {
+ // Only used for system padding, the real content item is the Row below
+ id: contentItem
+ }
+
QtObject {
id: d
@@ -139,7 +144,8 @@ MenuBarPrivate {
property int openedMenuIndex: -1
property bool preselectMenuItem: false
- property real heightPadding: style ? style.padding.top + style.padding.bottom : 0
+ property real heightPadding: (style ? style.padding.top + style.padding.bottom : 0)
+ + contentItem.systemPadding.top + contentItem.systemPadding.bottom
property bool altPressed: false
property bool altPressedAgain: false
@@ -219,9 +225,10 @@ MenuBarPrivate {
Row {
id: row
- x: d.style ? d.style.padding.left : 0
- y: d.style ? d.style.padding.top : 0
+ x: (d.style ? d.style.padding.left : 0) + contentItem.systemPadding.left
+ y: (d.style ? d.style.padding.top : 0) + contentItem.systemPadding.top
width: parent.width - (d.style ? d.style.padding.left + d.style.padding.right : 0)
+ - (contentItem.systemPadding.left + contentItem.systemPadding.right)
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
Repeater {