mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
CURA-4400 added context menu on right click extruder in SidebarHeader
This commit is contained in:
parent
657a52a5e7
commit
c94d88cd9d
1 changed files with 32 additions and 3 deletions
|
@ -91,10 +91,39 @@ Column
|
|||
exclusiveGroup: extruderMenuGroup
|
||||
checked: base.currentExtruderIndex == index
|
||||
|
||||
onClicked:
|
||||
MouseArea
|
||||
{
|
||||
forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(index);
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: {
|
||||
switch (mouse.button) {
|
||||
case Qt.LeftButton:
|
||||
forceActiveFocus(); // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(index);
|
||||
break;
|
||||
case Qt.RightButton:
|
||||
extruderMenu.popup();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Menu
|
||||
{
|
||||
id: extruderMenu
|
||||
|
||||
MenuItem {
|
||||
text: catalog.i18nc("@action:inmenu", "Enable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
|
||||
visible: !Cura.MachineManager.getExtruder(model.index).isEnabled
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: catalog.i18nc("@action:inmenu", "Disable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, false)
|
||||
visible: Cura.MachineManager.getExtruder(model.index).isEnabled
|
||||
}
|
||||
}
|
||||
|
||||
style: ButtonStyle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue