Properly limit width of text in subsubmenu

Getting rid of the layout makes a lot of things simpler here.

Contributes to issue CURA-8640.
This commit is contained in:
Ghostkeeper 2022-04-08 16:57:22 +02:00
parent d46679c19f
commit af33073b29
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -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