From 46cd9e081bae95996d438043041eb95b84f5193b Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 17 Jun 2015 17:38:51 +0200 Subject: [PATCH 1/2] 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 From ddbb952d9ce55bf2f528d6c9c9f0cca5d09dafd4 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 17 Jun 2015 17:43:03 +0200 Subject: [PATCH 2/2] Add a background to the tooltip label so long strings also have background Contributes to #57 --- resources/themes/cura/styles.qml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 243c12aedb..d172fdb6d0 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -103,12 +103,17 @@ QtObject { opacity: control.hovered ? 1.0 : 0.0; Behavior on opacity { NumberAnimation { duration: 100; } } - Label { - id: label + Rectangle { anchors.horizontalCenter: parent.horizontalCenter; - text: control.text.replace("&", ""); - font: UM.Theme.fonts.button_tooltip; - color: UM.Theme.colors.button_tooltip_text; + width: childrenRect.width; + height: childrenRect.height; + + Label { + id: label + text: control.text.replace("&", ""); + font: UM.Theme.fonts.button_tooltip; + color: UM.Theme.colors.button_tooltip_text; + } } }