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.
This commit is contained in:
Fushan Wen 2021-11-12 18:07:12 +08:00
parent cd4bdaa8fe
commit 25b035e84c

View file

@ -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()
}
}
}