Let quality intents menu use checkmark to indicate active profile

CURA-8928
This commit is contained in:
Jaime van Kessel 2022-03-03 13:46:38 +01:00
parent fc577ffcbc
commit cbbe961a44
3 changed files with 30 additions and 8 deletions

View file

@ -222,7 +222,7 @@ Item
id: updateProfileAction id: updateProfileAction
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null
text: catalog.i18nc("@action:inmenu menubar:profile", "&Update profile with current settings/overrides"); text: catalog.i18nc("@action:inmenu menubar:profile", "&Update profile with current settings/overrides");
onTriggered: Cura.ContainerManager.updateQualityChanges(); onTriggered: Cura.ContainerManager.updateQualityChanges()
} }
Action Action

View file

@ -19,10 +19,14 @@ Button
id: button id: button
hoverEnabled: true hoverEnabled: true
leftPadding: UM.Theme.getSize("default_margin").width leftPadding: UM.Theme.getSize("default_margin").width
implicitWidth: UM.Theme.getSize("menu").width
implicitHeight: UM.Theme.getSize("menu").height + UM.Theme.getSize("narrow_margin").height
background: Rectangle background: Rectangle
{ {
id: backgroundRectanglewide_margin id: backgroundRectanglewide_margin
height: button.height
width: button.width
color: button.hovered ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1") color: button.hovered ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1")
} }
@ -37,11 +41,29 @@ Button
return txt return txt
} }
contentItem: UM.Label contentItem: Item
{ {
id: textLabel height: button.height
text: button.text != "" ? replaceText(button.text) : replaceText(button.labelText) width: button.width
height: contentHeight UM.RecolorImage
color: button.enabled ? UM.Theme.getColor("text") :UM.Theme.getColor("text_inactive") {
id: check
height: UM.Theme.getSize("default_arrow").height
width: height
source: UM.Theme.getIcon("Check", "low")
color: UM.Theme.getColor("setting_control_text")
anchors.verticalCenter: parent.verticalCenter
visible: button.checked
}
UM.Label
{
id: textLabel
text: button.text != "" ? replaceText(button.text) : replaceText(button.labelText)
height: contentHeight
color: button.enabled ? UM.Theme.getColor("text") :UM.Theme.getColor("text_inactive")
anchors.left: check.right
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
anchors.verticalCenter: parent.verticalCenter
}
} }
} }

View file

@ -130,7 +130,7 @@ Popup
checkable: true checkable: true
visible: model.available visible: model.available
text: model.name + " - " + model.layer_height + " mm" text: model.name + " - " + model.layer_height + " mm"
leftPadding: UM.Theme.getSize("wide_margin").width leftPadding: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("narrow_margin").width
checked: checked:
{ {
if (Cura.MachineManager.hasCustomQuality) if (Cura.MachineManager.hasCustomQuality)
@ -196,7 +196,7 @@ Popup
checkable: true checkable: true
visible: model.available visible: model.available
text: model.name text: model.name
leftPadding: UM.Theme.getSize("wide_margin").width leftPadding: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("narrow_margin").width
checked: checked:
{ {
var active_quality_group = Cura.MachineManager.activeQualityChangesGroup var active_quality_group = Cura.MachineManager.activeQualityChangesGroup