From 2fa29de4b917ac0c2cad4ef232a4d14bf74c4d43 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 1 Dec 2015 16:24:07 +0100 Subject: [PATCH] Use PointingRectangle for toolpanel flyouts --- resources/qml/Toolbar.qml | 32 +++++++++++++++++++++++--------- resources/themes/cura/styles.qml | 2 +- resources/themes/cura/theme.json | 1 + 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 895144e559..4eca81a4a6 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -13,7 +13,7 @@ Item { width: buttons.width; height: buttons.height - //property int activeY + property int activeY ColumnLayout { id: buttons; @@ -43,22 +43,25 @@ Item { anchors.fill: parent; onClicked: { parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id); - //base.activeY = parent.y + base.activeY = parent.y } } } } } - Rectangle { - id: panelBackground; + UM.PointingRectangle { + id: panelBorder; anchors.left: parent.right; anchors.leftMargin: UM.Theme.sizes.default_margin.width; - anchors.top: parent.top; - //y: base.activeY + anchors.top: base.top; + anchors.topMargin: base.activeY z: buttons.z -1 + target: Qt.point(parent.right, base.activeY + UM.Theme.sizes.button.height/2) + arrowSize: UM.Theme.sizes.default_arrow.width + width: { if (panel.item && panel.width > 0){ return Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width) @@ -72,9 +75,20 @@ Item { opacity: panel.item ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100 } } - color: UM.Theme.colors.tool_panel_background; - border.width: UM.Theme.sizes.default_lining.width - border.color: UM.Theme.colors.lining + color: UM.Theme.colors.lining; + //border.width: UM.Theme.sizes.default_lining.width + //border.color: UM.Theme.colors.lining + + UM.PointingRectangle { + id: panelBackground; + + color: UM.Theme.colors.tool_panel_background; + anchors.fill: parent + anchors.margins: UM.Theme.sizes.default_lining.width + + target: Qt.point(-UM.Theme.sizes.default_margin.width, UM.Theme.sizes.button.height/2) + arrowSize: parent.arrowSize + } Loader { id: panel diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 4ccede85ff..dad5f8b2a6 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -117,7 +117,7 @@ QtObject { color: UM.Theme.colors.button_tooltip; anchors.fill: parent anchors.margins: UM.Theme.sizes.default_lining.width - target: Qt.point(- UM.Theme.sizes.default_lining.width, parent.height/2) + target: Qt.point(-UM.Theme.sizes.default_lining.width, parent.height/2) arrowSize: parent.arrowSize } diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 2c02f731fe..f3f865d63e 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -165,6 +165,7 @@ "window_margin": [1.0, 1.0], "default_margin": [1.0, 1.0], "default_lining": [0.08, 0.08], + "default_arrow": [0.8, 0.8], "logo": [9.5, 2.0], "sidebar": [30.0, 10.0],