mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Show a visual indication of enabled directly after click
This doesn't actually speed up the process, but it does give some indication that something is going on while the changes are happening Contributes to #8250
This commit is contained in:
parent
8c0e21f0d5
commit
b09a88075e
@ -222,11 +222,18 @@ Item
|
||||
OldControls.CheckBox
|
||||
{
|
||||
id: enabledCheckbox
|
||||
checked: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.isEnabled : false
|
||||
enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder.
|
||||
height: parent.height
|
||||
style: UM.Theme.styles.checkbox
|
||||
|
||||
Binding
|
||||
{
|
||||
target: enabledCheckbox
|
||||
property: "checked"
|
||||
value: Cura.MachineManager.activeStack.isEnabled
|
||||
when: Cura.MachineManger.activeStack != null
|
||||
}
|
||||
|
||||
/* Use a MouseArea to process the click on this checkbox.
|
||||
This is necessary because actually clicking the checkbox
|
||||
causes the "checked" property to be overwritten. After
|
||||
@ -235,8 +242,17 @@ Item
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
onClicked: Cura.MachineManager.setExtruderEnabled(Cura.ExtruderManager.activeExtruderIndex, !parent.checked)
|
||||
enabled: parent.enabled
|
||||
onClicked:
|
||||
{
|
||||
if(!parent.enabled)
|
||||
{
|
||||
return
|
||||
}
|
||||
// Already update the visual indication
|
||||
parent.checked = !parent.checked
|
||||
// Update the settings on the background!
|
||||
Cura.MachineManager.setExtruderEnabled(Cura.ExtruderManager.activeExtruderIndex, parent.checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user