Commit 76edffa6 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

desktoppackage: add arrow key navigation support in widget explorer

`keyNavigationWraps` is disabled to allow to switch focus to the search
field by pressing up arrow key when the topmost items has focus.
parent f4cd31e7
Pipeline #230918 passed with stage
in 3 minutes and 43 seconds
......@@ -205,6 +205,10 @@ PC3.Page {
id: getWidgetsButton
icon.name: "get-hot-new-stuff"
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Get New Widgets…")
KeyNavigation.right: closeButton
KeyNavigation.down: searchInput
onClicked: {
getWidgetsDialog.model = widgetExplorer.widgetsMenuActions
getWidgetsDialog.openRelative()
......@@ -213,6 +217,9 @@ PC3.Page {
PC3.ToolButton {
id: closeButton
icon.name: "window-close"
KeyNavigation.down: categoryButton
onClicked: main.closed()
}
}
......@@ -222,6 +229,9 @@ PC3.Page {
id: searchInput
Layout.fillWidth: true
KeyNavigation.down: list
KeyNavigation.right: categoryButton
onTextChanged: {
list.positionViewAtBeginning()
list.currentIndex = -1
......@@ -234,6 +244,9 @@ PC3.Page {
id: categoryButton
text: i18nd("plasma_shell_org.kde.plasma.desktop", "All Widgets")
icon.name: "view-filter"
KeyNavigation.down: list
onClicked: {
categoriesDialog.model = widgetExplorer.filterModel
categoriesDialog.open(0, categoryButton.height)
......@@ -276,7 +289,6 @@ PC3.Page {
// model set delayed by Timer above
activeFocusOnTab: true
keyNavigationWraps: true
cellWidth: Math.floor(width / 3)
cellHeight: cellWidth + PlasmaCore.Units.gridUnit * 4 + PlasmaCore.Units.smallSpacing * 2
......@@ -315,6 +327,8 @@ PC3.Page {
duration: PlasmaCore.Units.shortDuration
}
}
KeyNavigation.up: searchInput
}
}
......
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