mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Use MouseArea to catch click instead of onClicked
This is necessary because when you click it, the 'checked' property no longer depends on the active extruder. So prevent it from being clicked at all and handle the click separately in this MouseArea. Contributes to issue CURA-5876.
This commit is contained in:
parent
ed37e692a3
commit
82d4897ba4
1 changed files with 11 additions and 1 deletions
|
@ -136,9 +136,19 @@ Item
|
|||
OldControls.CheckBox
|
||||
{
|
||||
checked: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.isEnabled : false
|
||||
onClicked: Cura.MachineManager.setExtruderEnabled(selectors.model.index, checked)
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
style: UM.Theme.styles.checkbox
|
||||
|
||||
/* 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
|
||||
it's been overwritten, the original link that made it
|
||||
depend on the active extruder stack is broken. */
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
onClicked: Cura.MachineManager.setExtruderEnabled(Cura.ExtruderManager.activeExtruderIndex, !parent.checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue