From 25b035e84c76b84cc5637321819a787cba9640ff Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Fri, 12 Nov 2021 18:07:12 +0800 Subject: [PATCH] effects/overview: Press Enter to create a new desktop Add `Keys.onReturnPressd` and `Keys.onEnterPressed` to PC3.Button in DesktopBar, so user can trigger the action by pressing Enter. --- src/effects/overview/qml/DesktopBar.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/effects/overview/qml/DesktopBar.qml b/src/effects/overview/qml/DesktopBar.qml index ef2ae95f24..8ea3b29a84 100644 --- a/src/effects/overview/qml/DesktopBar.qml +++ b/src/effects/overview/qml/DesktopBar.qml @@ -241,7 +241,9 @@ Item { height: bar.desktopHeight icon.name: "list-add" opacity: hovered ? 1 : 0.75 - onClicked: desktopModel.create(desktopModel.rowCount()) + action: Action { + onTriggered: desktopModel.create(desktopModel.rowCount()) + } ToolTip.text: i18n("Add Desktop") ToolTip.visible: hovered @@ -257,6 +259,9 @@ Item { drag.source.desktop = desktopModel.rowCount() + 1; } } + + Keys.onReturnPressed: action.trigger() + Keys.onEnterPressed: action.trigger() } } }