From 701fc52a4a0138d6b9f537cb8fddd100d9b2e0fd Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Wed, 1 Jun 2022 08:57:54 -0600 Subject: [PATCH] effects/desktopgrid: re-add shortcuts to add and remove desktops This got lost in the QML port. BUG: 451848 --- src/effects/desktopgrid/qml/main.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/effects/desktopgrid/qml/main.qml b/src/effects/desktopgrid/qml/main.qml index 3dc45489fe..db5a365a1d 100644 --- a/src/effects/desktopgrid/qml/main.qml +++ b/src/effects/desktopgrid/qml/main.qml @@ -33,7 +33,15 @@ Rectangle { container.organized = false; } - Keys.onEscapePressed: effect.deactivate(effect.animationDuration); + Keys.onPressed: { + if (event.key == Qt.Key_Escape) { + effect.deactivate(effect.animationDuration); + } else if (event.key == Qt.Key_Plus || event.key == Qt.Key_Equal) { + addButton.clicked(); + } else if (event.key == Qt.Key_Minus) { + removeButton.clicked(); + } + } Keys.priority: Keys.AfterItem KWinComponents.VirtualDesktopModel { @@ -167,10 +175,12 @@ Rectangle { } visible: container.effect.showAddRemove PC3.Button { + id: addButton icon.name: "list-add" onClicked: container.effect.addDesktop() } PC3.Button { + id: removeButton icon.name: "list-remove" onClicked: container.effect.removeDesktop() }