Verified Commit 068b27e6 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applets/trash: add keyboard navigation support

parent ebb1a93f
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.0
import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
......@@ -52,6 +52,17 @@ DragDrop.DropArea {
preventStealing: true
Keys.onPressed: {
switch (event.key) {
case Qt.Key_Space:
case Qt.Key_Enter:
case Qt.Key_Return:
case Qt.Key_Select:
Plasmoid.activated();
break;
}
}
onDragEnter: containsAcceptableDrag = TrashPrivate.Trash.trashableUrls(event.mimeData.urls).length > 0
onDragLeave: containsAcceptableDrag = false
......@@ -100,6 +111,9 @@ DragDrop.DropArea {
MouseArea {
id: mouseArea
anchors.fill: parent
activeFocusOnTab: true
onClicked: Qt.openUrlExternally("trash:/");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment