Fix layout of subitems

Contributes to issue CURA-8640.
This commit is contained in:
Ghostkeeper 2022-04-08 15:28:50 +02:00
parent 45bc498c7f
commit b40900e146
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -116,6 +116,7 @@ Cura.MenuItem
Column Column
{ {
id: materialTypesList id: materialTypesList
spacing: 0
Repeater Repeater
{ {
@ -123,15 +124,10 @@ Cura.MenuItem
//Use a MouseArea and Rectangle, not a button, because the button grabs mouse events which makes the parent pop-up think it's no longer being hovered. //Use a MouseArea and Rectangle, not a button, because the button grabs mouse events which makes the parent pop-up think it's no longer being hovered.
//With a custom MouseArea, we can prevent the events from being accepted. //With a custom MouseArea, we can prevent the events from being accepted.
delegate: Item delegate: Rectangle
{ {
width: materialTypeLabel.width height: UM.Theme.getSize("menu").height
height: materialTypeLabel.height width: UM.Theme.getSize("menu").width
Rectangle
{
width: materialTypesList.width
height: parent.height
color: materialTypeButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1") color: materialTypeButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
@ -144,12 +140,37 @@ Cura.MenuItem
onEntered: menuPopup.itemHovered += 1 onEntered: menuPopup.itemHovered += 1
onExited: menuPopup.itemHovered -= 1 onExited: menuPopup.itemHovered -= 1
} }
RowLayout
{
spacing: 0
opacity: materialBrandMenu.enabled ? 1 : 0.5
height: parent.height
Item
{
// Spacer
width: UM.Theme.getSize("default_margin").width
} }
UM.Label UM.Label
{ {
id: materialTypeLabel
text: model.name text: model.name
Layout.fillWidth: true
Layout.fillHeight: true
elide: Label.ElideRight
wrapMode: Text.NoWrap
}
Item
{
Layout.fillWidth: true
}
Item
{
// Right side margin
width: UM.Theme.getSize("default_margin").width
}
} }
} }
} }