From af33073b29e3a0190d7c7294dc6e90be968cf297 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 8 Apr 2022 16:57:22 +0200 Subject: [PATCH] Properly limit width of text in subsubmenu Getting rid of the layout makes a lot of things simpler here. Contributes to issue CURA-8640. --- resources/qml/Menus/MaterialBrandMenu.qml | 33 ++++++++--------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/resources/qml/Menus/MaterialBrandMenu.qml b/resources/qml/Menus/MaterialBrandMenu.qml index c558850b51..a781192bdb 100644 --- a/resources/qml/Menus/MaterialBrandMenu.qml +++ b/resources/qml/Menus/MaterialBrandMenu.qml @@ -254,17 +254,10 @@ Cura.MenuItem color: materialColorButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1") - RowLayout + Item { - spacing: 0 opacity: materialBrandMenu.enabled ? 1 : 0.5 - height: parent.height - - Item - { - // Spacer - width: UM.Theme.getSize("default_margin").width + (model.id === materialMenu.activeMaterialId ? 0 : UM.Theme.getSize("default_arrow").height) - } + anchors.fill: parent //Checkmark, if the material is selected. UM.RecolorImage @@ -273,6 +266,9 @@ Cura.MenuItem visible: model.id === materialMenu.activeMaterialId height: UM.Theme.getSize("default_arrow").height width: height + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.verticalCenter: parent.verticalCenter source: UM.Theme.getIcon("Check", "low") color: UM.Theme.getColor("setting_control_text") } @@ -280,22 +276,15 @@ Cura.MenuItem UM.Label { text: model.name - Layout.fillWidth: true - Layout.fillHeight: true + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("default_arrow").height + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_margin").width + elide: Label.ElideRight wrapMode: Text.NoWrap } - - Item - { - Layout.fillWidth: true - } - - Item - { - // Right side margin - width: UM.Theme.getSize("default_margin").width - } } MouseArea