mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-07 07:09:00 +08:00
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:
parent
d46679c19f
commit
af33073b29
@ -254,17 +254,10 @@ Cura.MenuItem
|
|||||||
|
|
||||||
color: materialColorButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
|
color: materialColorButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
|
||||||
|
|
||||||
RowLayout
|
Item
|
||||||
{
|
{
|
||||||
spacing: 0
|
|
||||||
opacity: materialBrandMenu.enabled ? 1 : 0.5
|
opacity: materialBrandMenu.enabled ? 1 : 0.5
|
||||||
height: parent.height
|
anchors.fill: parent
|
||||||
|
|
||||||
Item
|
|
||||||
{
|
|
||||||
// Spacer
|
|
||||||
width: UM.Theme.getSize("default_margin").width + (model.id === materialMenu.activeMaterialId ? 0 : UM.Theme.getSize("default_arrow").height)
|
|
||||||
}
|
|
||||||
|
|
||||||
//Checkmark, if the material is selected.
|
//Checkmark, if the material is selected.
|
||||||
UM.RecolorImage
|
UM.RecolorImage
|
||||||
@ -273,6 +266,9 @@ Cura.MenuItem
|
|||||||
visible: model.id === materialMenu.activeMaterialId
|
visible: model.id === materialMenu.activeMaterialId
|
||||||
height: UM.Theme.getSize("default_arrow").height
|
height: UM.Theme.getSize("default_arrow").height
|
||||||
width: 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")
|
source: UM.Theme.getIcon("Check", "low")
|
||||||
color: UM.Theme.getColor("setting_control_text")
|
color: UM.Theme.getColor("setting_control_text")
|
||||||
}
|
}
|
||||||
@ -280,22 +276,15 @@ Cura.MenuItem
|
|||||||
UM.Label
|
UM.Label
|
||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.fillHeight: true
|
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
|
elide: Label.ElideRight
|
||||||
wrapMode: Text.NoWrap
|
wrapMode: Text.NoWrap
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
|
||||||
{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Item
|
|
||||||
{
|
|
||||||
// Right side margin
|
|
||||||
width: UM.Theme.getSize("default_margin").width
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea
|
MouseArea
|
||||||
|
Loading…
x
Reference in New Issue
Block a user