From 3d5f4e6bd663f53af2fa605cabad331f3488ea8e Mon Sep 17 00:00:00 2001 From: Tamara Hogenhout Date: Thu, 27 Aug 2015 14:59:33 +0200 Subject: [PATCH] 15.10 re-alignment of the toolbar This is a test to be reviewed Contributes to: issue CURA-60 --- resources/qml/Cura.qml | 9 ++++++--- resources/qml/Toolbar.qml | 27 ++++++++++++++++----------- resources/themes/cura/styles.qml | 11 +++++++---- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 77ad9f7b23..b69ed4534f 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -304,9 +304,12 @@ UM.MainWindow { id: toolbar; anchors { - horizontalCenter: parent.horizontalCenter - horizontalCenterOffset: -(UM.Theme.sizes.sidebar.width / 2) - top: parent.top; + left: parent.left + top: parent.top + topMargin: 74 + //horizontalCenter: parent.horizontalCenter + //horizontalCenterOffset: -(UM.Theme.sizes.sidebar.width / 2) + //top: parent.top; } } diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 542aceaa15..ca6b625b1b 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -13,8 +13,9 @@ Item { width: buttons.width; height: buttons.height + property int activeY - RowLayout { + ColumnLayout { id: buttons; anchors.bottom: parent.bottom; @@ -39,26 +40,30 @@ Item { //just catch the click so we do not trigger that behaviour. MouseArea { anchors.fill: parent; - onClicked: parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id); + onClicked: { + parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id); + base.activeY = parent.y + + } } } } } Rectangle { - width: base.width - 10 - height: base.height - z: parent.z - 1 - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - color: UM.Theme.colors.lining - } + width: base.width + height: base.height + z: parent.z - 1 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: UM.Theme.colors.lining + } Rectangle { id: panelBackground; - anchors.left: parent.left; - anchors.top: buttons.bottom; + anchors.left: parent.right; + y: base.activeY width: panel.item ? Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width) : 0; height: panel.item ? panel.height + 2 * UM.Theme.sizes.default_margin.height : 0; diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index f5f93bf547..01267eadb3 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -67,11 +67,14 @@ QtObject { Rectangle { id: tool_button_background - anchors.top: parent.bottom + anchors.left: parent.right + anchors.verticalCenter: parent.verticalCenter + //anchors.top: parent.bottom - width: label.width > parent.width ? label.width : parent.width - height: control.hovered ? label.height : 0; - Behavior on height { NumberAnimation { duration: 100; } } + //width: label.width > parent.width ? label.width : parent.width + width: control.hovered ? label.width : 0; + height: label.height + Behavior on width { NumberAnimation { duration: 100; } } opacity: control.hovered ? 1.0 : 0.0; Behavior on opacity { NumberAnimation { duration: 100; } }