From 3e908824b9f2de309605cea892c9942a0a7f8c4a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 18 Jul 2016 15:16:20 +0200 Subject: [PATCH] Added workaround for singleton not getting shortcuts CURA-1603 --- resources/qml/Cura.qml | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index f70dffa3cc..38019de8e2 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -506,6 +506,64 @@ UM.MainWindow onTriggered: preferences.getCurrentItem().showProfileNameDialog() } + // Workaround for shortcuts not working for singletons. + // The main window eats all the events, so we need to pass them manually. + Action + { + shortcut: StandardKey.Undo + onTriggered: Cura.Actions.undo.trigger() + } + Action + { + shortcut: StandardKey.Redo + onTriggered: Cura.Actions.redo.trigger() + } + Action + { + shortcut: StandardKey.Quit + onTriggered: Cura.Actions.quit.trigger() + } + Action + { + shortcut: StandardKey.Help + onTriggered: Cura.Actions.help.trigger() + } + Action + { + shortcut: StandardKey.Delete + onTriggered: Cura.Actions.delete.trigger() + } + Action + { + shortcut: "Ctrl+G" + onTriggered: Cura.Actions.groupObjects.trigger() + } + Action + { + shortcut: "Ctrl+Shift+G" + onTriggered: Cura.Actions.unGroupObjects.trigger() + } + Action + { + shortcut: "Ctrl+Alt+G" + onTriggered: Cura.Actions.mergeObjects.trigger() + } + Action + { + shortcut: "Ctrl+D" + onTriggered: Cura.Actions.deleteAll.trigger() + } + Action + { + shortcut: StandardKey.Open + onTriggered: Cura.Actions.open.trigger() + } + Action + { + shortcut: StandardKey.WhatsThis + onTriggered: Cura.Actions.showEngineLog.trigger() + } + Menu { id: objectContextMenu;