From 46cd9e081bae95996d438043041eb95b84f5193b Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 17 Jun 2015 17:38:51 +0200 Subject: [PATCH] Make sure the tool panel background is at least as wide as the active item This prevents odd rendering issues when items are differently sorted. Contributes to #57 --- resources/qml/Toolbar.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index d5126db481..ec7a6bd839 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -18,6 +18,7 @@ Item { id: activeItemBackground; anchors.bottom: parent.bottom; + anchors.bottomMargin: UM.Theme.sizes.default_margin.height; width: UM.Theme.sizes.button.width; height: UM.Theme.sizes.button.height * 2; @@ -59,7 +60,6 @@ Item { MouseArea { anchors.fill: parent; onClicked: parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id); - } } } @@ -72,7 +72,7 @@ Item { anchors.bottom: buttons.top; anchors.bottomMargin: UM.Theme.sizes.default_margin.height; - width: panel.item ? panel.width + 2 * UM.Theme.sizes.default_margin.width : 0; + width: panel.item ? Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width, activeItemBackground.x + activeItemBackground.width) : 0; height: panel.item ? panel.height + 2 * UM.Theme.sizes.default_margin.height : 0; opacity: panel.item ? 1 : 0