From 75f02fb0cdd3c712afa3e0bba8a9b4aa25fc640c Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Tue, 9 Aug 2022 22:06:22 +0800 Subject: [PATCH] applets/devicenotifier: forward keys to `ListView` So pressing arrow keys can navigate in the applet. --- .../package/contents/ui/FullRepresentation.qml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/applets/devicenotifier/package/contents/ui/FullRepresentation.qml b/applets/devicenotifier/package/contents/ui/FullRepresentation.qml index f211e0a88..e51449a1f 100644 --- a/applets/devicenotifier/package/contents/ui/FullRepresentation.qml +++ b/applets/devicenotifier/package/contents/ui/FullRepresentation.qml @@ -29,6 +29,8 @@ PlasmaExtras.Representation { collapseMarginsHint: true + Keys.forwardTo: [notifierDialog] + header: PlasmaExtras.PlasmoidHeading { visible: !(Plasmoid.containmentDisplayHints & PlasmaCore.Types.ContainmentDrawsPlasmoidHeading) && devicenotifier.mountedRemovables > 1 PlasmaComponents3.ToolButton { @@ -166,6 +168,11 @@ PlasmaExtras.Representation { } } + Keys.onDownPressed: { + notifierDialog.incrementCurrentIndex(); + notifierDialog.currentItem.forceActiveFocus(); + } + Loader { anchors.centerIn: parent width: parent.width - (PlasmaCore.Units.largeSpacing * 4)