diff options
author | Jack Ha <jackha@gmail.com> | 2018-03-13 15:14:33 +0300 |
---|---|---|
committer | Jack Ha <jackha@gmail.com> | 2018-03-13 15:14:33 +0300 |
commit | d6979bc89ad3d8c90be0336a294e08d69cea98e8 (patch) | |
tree | 88ec6963a22512210ca1fd3158ef8ca81924c45c /resources/qml/SidebarHeader.qml | |
parent | 0897c740b080b8f7ecc271b782bb18d983850dff (diff) |
CURA-4400 using an intermediate variable prevents an empty popup that occured now and then
Diffstat (limited to 'resources/qml/SidebarHeader.qml')
-rw-r--r-- | resources/qml/SidebarHeader.qml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 473f4c5cc8..4bda8074b1 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -91,6 +91,8 @@ Column exclusiveGroup: extruderMenuGroup checked: base.currentExtruderIndex == index + property bool extruder_enabled: true + MouseArea { anchors.fill: parent @@ -102,6 +104,7 @@ Column Cura.ExtruderManager.setActiveExtruderIndex(index); break; case Qt.RightButton: + extruder_enabled = Cura.MachineManager.getExtruder(model.index).isEnabled extruderMenu.popup(); break; } @@ -116,13 +119,13 @@ Column MenuItem { text: catalog.i18nc("@action:inmenu", "Enable Extruder") onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true) - visible: !Cura.MachineManager.getExtruder(model.index).isEnabled + visible: !extruder_enabled // using an intermediate variable prevents an empty popup that occured now and then } MenuItem { text: catalog.i18nc("@action:inmenu", "Disable Extruder") onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, false) - visible: Cura.MachineManager.getExtruder(model.index).isEnabled + visible: extruder_enabled } } |