From 5479479596f833087cd20f18fd13dadb39d00678 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 10 May 2022 17:48:05 +0200 Subject: [PATCH 1/3] Make parent item of ExtruderIcons handle all scaling. CURA-9106 --- .../qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 10 ++++++++-- .../Menus/ConfigurationMenu/CustomConfiguration.qml | 7 +++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 8d4fc9c2b5..29b5c8c4ae 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -36,6 +36,8 @@ Cura.ExpandablePopup headerItem: Item { + id: headerBase + // Horizontal list that shows the extruders and their materials RowLayout { @@ -51,9 +53,12 @@ Cura.ExpandablePopup { id: extruderItem - Layout.preferredWidth: Math.round(parent.width / extrudersModel.count) - Layout.maximumWidth: Math.round(parent.width / extrudersModel.count) + Layout.preferredWidth: Math.floor(headerBase.width / extrudersModel.count) + Layout.maximumWidth: Math.floor(headerBase.width / extrudersModel.count) + Layout.preferredHeight: headerBase.height + Layout.maximumHeight: headerBase.height Layout.fillHeight: true + Layout.alignment: Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignVCenter property var extruderStack: activeMachine ? activeMachine.extruderList[model.index]: null property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack) @@ -65,6 +70,7 @@ Cura.ExpandablePopup id: extruderIcon materialColor: model.color extruderEnabled: model.enabled + anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter } diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 7223706e63..c24c031e83 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -97,13 +97,16 @@ Item checked: model.index == 0 contentItem: Item { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + width: Math.floor(tabBar.height / extrudersModel.count) + height: tabBar.height Cura.ExtruderIcon { anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter materialColor: model.color extruderEnabled: model.enabled - width: parent.height - height: parent.height } } onClicked: From 16eb78a5a74d771d146d9a99749776005b0f40d4 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 10 May 2022 19:12:52 +0200 Subject: [PATCH 2/3] Properly align center. CURA-9106 --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 29b5c8c4ae..b75995df6f 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -58,7 +58,7 @@ Cura.ExpandablePopup Layout.preferredHeight: headerBase.height Layout.maximumHeight: headerBase.height Layout.fillHeight: true - Layout.alignment: Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignVCenter + Layout.alignment: Qt.AlignCenter property var extruderStack: activeMachine ? activeMachine.extruderList[model.index]: null property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack) From f0d3686ee7dc9dac9fad6bb6786587efdf21b752 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 11 May 2022 15:36:44 +0200 Subject: [PATCH 3/3] Fix alignment. CURA-9106 Co-authored-by: Casper Lamboo --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index b75995df6f..76d33c9c77 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -70,7 +70,6 @@ Cura.ExpandablePopup id: extruderIcon materialColor: model.color extruderEnabled: model.enabled - anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter }