From 0bcea3f4cd6661f4e42238eaf2e2c0783f3803e9 Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Fri, 20 Aug 2021 09:49:21 +0200 Subject: [PATCH 1/2] Fix long material names overlapping with extruder icons Both the `preferredWidth` AND the `width` need to be set for the labels to be properly elided if there is no more room in the ColumnLayout. In addition, the ColumnLayout that contains the variants and material names needs to be visible only if width>0, otherwise when the width is negative, for some reason the `materialTypeLabel` appears again. CURA-8496 --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 43ccde461e..a939eb2cf7 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -48,6 +48,7 @@ Cura.ExpandablePopup delegate: Item { Layout.preferredWidth: Math.round(parent.width / extrudersModel.count) + Layout.maximumWidth: Math.round(parent.width / extrudersModel.count) Layout.fillHeight: true // Extruder icon. Shows extruder index and has the same color as the active material. @@ -63,6 +64,7 @@ Cura.ExpandablePopup { opacity: model.enabled ? 1 : UM.Theme.getColor("extruder_disabled").a spacing: 0 + visible: width > 0 anchors { left: extruderIcon.right @@ -81,6 +83,7 @@ Cura.ExpandablePopup font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") renderType: Text.NativeRendering + Layout.preferredWidth: parent.width width: parent.width visible: !truncated @@ -95,6 +98,7 @@ Cura.ExpandablePopup font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") renderType: Text.NativeRendering + Layout.preferredWidth: parent.width width: parent.width visible: !materialBrandColorTypeLabel.visible && !truncated @@ -109,6 +113,7 @@ Cura.ExpandablePopup font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") renderType: Text.NativeRendering + Layout.preferredWidth: parent.width width: parent.width visible: !materialBrandColorTypeLabel.visible && !materialColorTypeLabel.visible } @@ -124,6 +129,7 @@ Cura.ExpandablePopup font: UM.Theme.getFont("default_bold") color: UM.Theme.getColor("text") renderType: Text.NativeRendering + Layout.preferredWidth: parent.width width: parent.width } } From b887398da6db5ab2b2629e904f0d83e5d24a4426 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 23 Aug 2021 10:56:43 +0200 Subject: [PATCH 2/2] Remove unneeded width from labels CURA-8496 --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index a939eb2cf7..8c09a5ffad 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -84,8 +84,6 @@ Cura.ExpandablePopup color: UM.Theme.getColor("text") renderType: Text.NativeRendering Layout.preferredWidth: parent.width - width: parent.width - visible: !truncated } @@ -99,8 +97,6 @@ Cura.ExpandablePopup color: UM.Theme.getColor("text") renderType: Text.NativeRendering Layout.preferredWidth: parent.width - width: parent.width - visible: !materialBrandColorTypeLabel.visible && !truncated } @@ -114,7 +110,6 @@ Cura.ExpandablePopup color: UM.Theme.getColor("text") renderType: Text.NativeRendering Layout.preferredWidth: parent.width - width: parent.width visible: !materialBrandColorTypeLabel.visible && !materialColorTypeLabel.visible } // Label that shows the name of the variant @@ -130,7 +125,6 @@ Cura.ExpandablePopup color: UM.Theme.getColor("text") renderType: Text.NativeRendering Layout.preferredWidth: parent.width - width: parent.width } } }