diff --git a/qml/windowed/AlphabetCategoryPopup.qml b/qml/windowed/AlphabetCategoryPopup.qml index 8caa25cf..2e04b90b 100644 --- a/qml/windowed/AlphabetCategoryPopup.qml +++ b/qml/windowed/AlphabetCategoryPopup.qml @@ -31,6 +31,15 @@ Popup { width: alphabetCategoryContainer.width + 20 height: alphabetCategoryContainer.height + 20 + function setCurrentCategory(category) { + for (let i = 0; i < alphabetCategoryDelegateModel.model.length; i++) { + if (alphabetCategoryDelegateModel.model[i] === category) { + alphabetCategoryContainer.currentIndex = i + break + } + } + } + DelegateModel { id: alphabetCategoryDelegateModel @@ -100,6 +109,18 @@ Popup { activeFocusOnTab: gridViewFocus } + Item { + focus: root.visible + Keys.onPressed: function (event) { + if (event.key === Qt.Key_Left || + event.key === Qt.Key_Right || + event.key === Qt.Key_Up || + event.key === Qt.Key_Down) { + alphabetCategoryContainer.focus = true + } + } + } + background: FloatingPanel { radius: DStyle.Style.popup.radius dropShadowColor: null diff --git a/qml/windowed/AppListView.qml b/qml/windowed/AppListView.qml index 33c5d09f..e037945d 100644 --- a/qml/windowed/AppListView.qml +++ b/qml/windowed/AppListView.qml @@ -129,6 +129,7 @@ FocusScope { onClicked: { if (CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.Alphabetary) { alphabetCategoryPopup.existingSections = CategorizedSortProxyModel.alphabetarySections() + alphabetCategoryPopup.setCurrentCategory(section.toUpperCase()) var mousePos = mapToItem(listView, mouseX, mouseY) var y = (mousePos.y + alphabetCategoryPopup.height) < listView.height ? mousePos.y : listView.height - alphabetCategoryPopup.height alphabetCategoryPopup.y = y diff --git a/qml/windowed/GridViewContainer.qml b/qml/windowed/GridViewContainer.qml index e93a2102..e1d1c7be 100644 --- a/qml/windowed/GridViewContainer.qml +++ b/qml/windowed/GridViewContainer.qml @@ -36,6 +36,7 @@ FocusScope { readonly property alias gridViewWidth: gridView.width property alias highlight: gridView.highlight property ScrollBar vScrollBar + property alias currentIndex: gridView.currentIndex function positionViewAtBeginning() { gridView.positionViewAtBeginning()