From 759b5b58476c3d2be6c0faf5118fc052f1d6bec8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 14:23:41 +0100 Subject: [PATCH] Use anchors rather than a calculation with padding It's supposed to be slightly more efficient. Contributes to issue CURA-5876. --- .../ConfigurationMenu/ConfigurationItem.qml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 3ea220c91e..7ba7202819 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -34,7 +34,13 @@ Button { id: extruderRow - width: parent.width - 2 * parent.padding + anchors + { + left: parent.left + leftMargin: parent.padding + right: parent.right + rightMargin: parent.padding + } height: childrenRect.height spacing: UM.Theme.getSize("default_margin").width @@ -58,7 +64,13 @@ Button id: separator visible: buildplateInformation.visible - width: parent.width - 2 * parent.padding + anchors + { + left: parent.left + leftMargin: parent.padding + right: parent.right + rightMargin: parent.padding + } height: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0 color: UM.Theme.getColor("text") } @@ -66,7 +78,14 @@ Button Item { id: buildplateInformation - width: parent.width - 2 * parent.padding + + anchors + { + left: parent.left + leftMargin: parent.padding + right: parent.right + rightMargin: parent.padding + } height: childrenRect.height visible: configuration.buildplateConfiguration != ""