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

applets/systemtray: support arrow key navigation

parent 890ce08b
Pipeline #219181 passed with stage
in 11 minutes and 58 seconds
......@@ -63,6 +63,9 @@ Item {
display: PlasmaComponents.AbstractButton.IconOnly
text: i18nc("@action:button", "Go Back")
KeyNavigation.down: hiddenItemsView.visible ? hiddenLayout : container
KeyNavigation.right: actionsButton.visible ? actionsButton : actionsButton.KeyNavigation.right
onClicked: systemTrayState.setActiveApplet(null)
}
......@@ -91,6 +94,10 @@ Item {
Accessible.role: actionsButton.singleAction ? Accessible.Button : Accessible.ButtonMenu
KeyNavigation.down: backButton.KeyNavigation.down
KeyNavigation.left: backButton
KeyNavigation.right: configureButton.visible ? configureButton : configureButton.KeyNavigation.right
// NOTE: it needs an IconItem because QtQuickControls2 buttons cannot load QIcons as their icon
PlasmaCore.IconItem {
parent: actionsButton
......@@ -147,12 +154,17 @@ Item {
}
}
PlasmaComponents.ToolButton {
id: configureButton
icon.name: "configure"
visible: actionsButton.applet && actionsButton.applet.action("configure")
display: PlasmaComponents.AbstractButton.IconOnly
text: actionsButton.applet.action("configure").text
KeyNavigation.down: backButton.KeyNavigation.down
KeyNavigation.left: actionsButton.visible ? actionsButton : actionsButton.KeyNavigation.left
KeyNavigation.right: pinButton
PlasmaComponents.ToolTip {
text: parent.visible ? parent.text : ""
}
......@@ -169,6 +181,9 @@ Item {
display: PlasmaComponents.AbstractButton.IconOnly
text: i18n("Keep Open")
KeyNavigation.down: backButton.KeyNavigation.down
KeyNavigation.left: configureButton.visible ? configureButton : configureButton.KeyNavigation.left
PlasmaComponents.ToolTip {
text: parent.text
}
......@@ -182,6 +197,9 @@ Item {
Layout.fillHeight: true
Layout.topMargin: PlasmaCore.Units.smallSpacing
visible: !systemTrayState.activeApplet
KeyNavigation.up: pinButton
onVisibleChanged: {
if (visible) {
layout.forceActiveFocus();
......
......@@ -77,6 +77,9 @@ PlasmaComponents3.ScrollView {
keyNavigationEnabled: true
activeFocusOnTab: true
KeyNavigation.up: hiddenTasksView.KeyNavigation.up
onActiveFocusChanged: {
if (activeFocus && currentIndex === -1) {
currentIndex = 0
......
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