From 077b34b4336fee026ee37f43a27e7bb13c9b9b4a Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 27 Nov 2018 14:49:01 +0100 Subject: [PATCH] Fix size of the extruder icon Now it should look the same in all places. --- resources/qml/ExtruderButton.qml | 14 +++++++++----- resources/qml/ExtruderIcon.qml | 2 -- resources/themes/cura-light/theme.json | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/resources/qml/ExtruderButton.qml b/resources/qml/ExtruderButton.qml index 8a1f0af44a..d7cbdc52bc 100644 --- a/resources/qml/ExtruderButton.qml +++ b/resources/qml/ExtruderButton.qml @@ -19,12 +19,16 @@ Button enabled: UM.Selection.hasSelection && extruder.stack.isEnabled background: Item {} - contentItem: ExtruderIcon + contentItem: Item { - width: UM.Theme.getSize("button_icon").width - materialColor: model.color - extruderEnabled: extruder.stack.isEnabled - property int index: extruder.index + // For some reason if the extruder icon is not enclosed to the item, the size changes to fill the size of the button + ExtruderIcon + { + anchors.centerIn: parent + materialColor: model.color + extruderEnabled: extruder.stack.isEnabled + property int index: extruder.index + } } onClicked: diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index 8f312adb85..c1a202050b 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -51,8 +51,6 @@ Item anchors.centerIn: parent text: index + 1 font: UM.Theme.getFont("extruder_icon") - width: contentWidth - height: contentHeight visible: extruderEnabled renderType: Text.NativeRendering horizontalAlignment: Text.AlignHCenter diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 157adcf6a5..d2358e36ff 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -402,7 +402,7 @@ "thin_margin": [0.71, 0.71], "narrow_margin": [0.5, 0.5], - "extruder_icon": [1.8, 1.8], + "extruder_icon": [2.33, 2.33], "section": [0.0, 2.2], "section_icon": [1.6, 1.6],