Commit b4e424e0 authored by Jens Bache-Wiig's avatar Jens Bache-Wiig Committed by The Qt Project
Browse files

Automatically set toolbar width


Change-Id: I4038afc1cb22102f8873014d90dedec79cbaa376
Reviewed-by: default avatarJ-P Nurmi <jpnurmi@digia.com>
parent 8f46d851
Branches
Tags
No related merge requests found
Showing with 9 additions and 9 deletions
...@@ -69,9 +69,8 @@ ApplicationWindow { ...@@ -69,9 +69,8 @@ ApplicationWindow {
onAccepted: imageViewer.open(fileUrl) onAccepted: imageViewer.open(fileUrl)
} }
ToolBar { toolBar: ToolBar {
id: toolbar id: toolbar
width: parent.width
RowLayout { RowLayout {
spacing: 2 spacing: 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
...@@ -265,10 +264,7 @@ ApplicationWindow { ...@@ -265,10 +264,7 @@ ApplicationWindow {
id:frame id:frame
enabled: enabledCheck.checked enabled: enabledCheck.checked
tabPosition: controlPage.item ? controlPage.item.tabPosition : Qt.TopEdge tabPosition: controlPage.item ? controlPage.item.tabPosition : Qt.TopEdge
anchors.top: toolbar.bottom anchors.fill: parent
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.margins: Qt.platform.os === "mac" ? 12 : 2 anchors.margins: Qt.platform.os === "mac" ? 12 : 2
Tab { Tab {
......
...@@ -141,11 +141,12 @@ Window { ...@@ -141,11 +141,12 @@ Window {
id: backgroundItem id: backgroundItem
anchors.fill: parent anchors.fill: parent
Row { Item {
id: toolBarArea id: toolBarArea
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: childrenRect.height
} }
Item { Item {
...@@ -156,11 +157,12 @@ Window { ...@@ -156,11 +157,12 @@ Window {
anchors.bottom: statusBarArea.top anchors.bottom: statusBarArea.top
} }
Row { Item {
id: statusBarArea id: statusBarArea
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: childrenRect.height
} }
onVisibleChanged: if (visible && menuBar) menuBar.__parentWindow = root onVisibleChanged: if (visible && menuBar) menuBar.__parentWindow = root
......
...@@ -70,7 +70,8 @@ Item { ...@@ -70,7 +70,8 @@ Item {
id: statusbar id: statusbar
activeFocusOnTab: false activeFocusOnTab: false
Accessible.role: Accessible.StatusBar Accessible.role: Accessible.StatusBar
implicitWidth: parent ? parent.width : loader.item ? loader.item.implicitHeight : 0 width: parent ? parent.width : implicitWidth
implicitWidth: loader.item.implicitHeight
implicitHeight: loader.item ? loader.item.implicitHeight : 0 implicitHeight: loader.item ? loader.item.implicitHeight : 0
property Component style: Qt.createComponent(Settings.theme() + "/StatusBarStyle.qml", statusbar) property Component style: Qt.createComponent(Settings.theme() + "/StatusBarStyle.qml", statusbar)
Loader { Loader {
......
...@@ -73,6 +73,7 @@ Item { ...@@ -73,6 +73,7 @@ Item {
id: toolbar id: toolbar
activeFocusOnTab: false activeFocusOnTab: false
Accessible.role: Accessible.ToolBar Accessible.role: Accessible.ToolBar
width: parent ? parent.width : implicitWidth
implicitWidth: loader.item ? loader.item.implicitWidth : 0 implicitWidth: loader.item ? loader.item.implicitWidth : 0
implicitHeight: loader.item ? loader.item.implicitHeight : 0 implicitHeight: loader.item ? loader.item.implicitHeight : 0
property Component style: Qt.createComponent(Settings.theme() + "/ToolBarStyle.qml", toolbar) property Component style: Qt.createComponent(Settings.theme() + "/ToolBarStyle.qml", toolbar)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment