diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-09-19 18:03:14 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-09-19 18:03:14 +0200 |
commit | 77703754d73b9309683c83ca4460e599eb8f28e2 (patch) | |
tree | f5da2114b88a929dd58a36437c9181adc2783063 /src/controls/ApplicationWindow.qml | |
parent | faa5f59e2f26a5c4cf8b681443f2209d1b516b9c (diff) | |
parent | c3b5a796820d792c5c36e472b917e5a47b28763b (diff) | |
download | qtquickcontrols-77703754d73b9309683c83ca4460e599eb8f28e2.tar.gz |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/controls/Styles/iOS/ComboBoxStyle.qml
src/controls/Styles/iOS/SpinBoxStyle.qml
src/controls/Styles/iOS/TextAreaStyle.qml
src/controls/Styles/iOS/TextFieldStyle.qml
src/controls/Styles/iOS/iOS.pro
Change-Id: Ib31ead16807a952a39aaa611b27ad89d4f86c60c
Diffstat (limited to 'src/controls/ApplicationWindow.qml')
-rw-r--r-- | src/controls/ApplicationWindow.qml | 94 |
1 files changed, 27 insertions, 67 deletions
diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml index bc2bf329..94745b47 100644 --- a/src/controls/ApplicationWindow.qml +++ b/src/controls/ApplicationWindow.qml @@ -155,7 +155,10 @@ Window { property alias __style: styleLoader.item /*! \internal */ - property real __topBottomMargins: contentArea.y + statusBarArea.height + property alias __panel: panelLoader.item + + /*! \internal */ + property real __topBottomMargins: __panel.contentArea.y + __panel.statusBarArea.height /*! \internal There is a similar macro QWINDOWSIZE_MAX in qwindow_p.h that is used to limit the range of QWindow::maximum{Width,Height} @@ -195,11 +198,6 @@ Window { maximumWidth: Math.min(__qwindowsize_max, contentArea.maximumWidth) maximumHeight: Math.min(__qwindowsize_max, contentArea.maximumHeight + __topBottomMargins) - onToolBarChanged: { if (toolBar) { toolBar.parent = toolBarArea } } - - onStatusBarChanged: { if (statusBar) { statusBar.parent = statusBarArea } } - - onVisibleChanged: { if (visible && menuBar) { menuBar.__parentWindow = root } } /*! \internal */ default property alias data: contentArea.data @@ -210,76 +208,38 @@ Window { // 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 - Item { - id: backgroundItem + Loader { + id: panelLoader anchors.fill: parent - - Keys.forwardTo: menuBar ? [menuBar.__contentItem] : [] - + sourceComponent: __style ? __style.panel : null + onStatusChanged: if (status === Loader.Error) console.error("Failed to load Style for", root) Loader { - id: backgroundLoader - anchors.fill: parent - sourceComponent: __style ? __style.background : null - onStatusChanged: if (status === Loader.Error) console.error("Failed to load Style for", root) - Loader { - id: styleLoader - sourceComponent: style - property var __control: root - property QtObject styleData: QtObject { - readonly property bool hasColor: root.color != "#ffffff" - } - onStatusChanged: if (status === Loader.Error) console.error("Failed to load Style for", root) + id: styleLoader + sourceComponent: style + property var __control: root + property QtObject styleData: QtObject { + readonly property bool hasColor: root.color != "#ffffff" } + onStatusChanged: if (status === Loader.Error) console.error("Failed to load Style for", root) } - ContentItem { - id: contentArea - anchors.top: toolBarArea.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: statusBarArea.top - } - - Item { - id: toolBarArea - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - implicitHeight: childrenRect.height - height: visibleChildren.length > 0 ? implicitHeight: 0 - } - - Item { - id: statusBarArea - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - implicitHeight: childrenRect.height - height: visibleChildren.length > 0 ? implicitHeight: 0 - } - - onVisibleChanged: if (visible && menuBar) menuBar.__parentWindow = root + Binding { target: toolBar; property: "parent"; value: __panel.toolBarArea } + Binding { target: statusBar; property: "parent"; value: __panel.statusBarArea } - states: State { - name: "hasMenuBar" + Binding { + property: "parent" + target: menuBar ? menuBar.__contentItem : null when: menuBar && !menuBar.__isNative + value: __panel.menuBarArea + } + Binding { target: menuBar; property: "__parentWindow"; value: root } - ParentChange { - target: menuBar.__contentItem - parent: backgroundItem - } - - PropertyChanges { - target: menuBar.__contentItem - x: 0 - y: 0 - width: backgroundItem.width - } + Keys.forwardTo: menuBar ? [menuBar.__contentItem] : [] - AnchorChanges { - target: toolBarArea - anchors.top: menuBar.__contentItem.bottom - } + ContentItem { + id: contentArea + anchors.fill: parent + parent: __panel.contentArea } } } |