Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions qml/windowed/AlphabetCategoryPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions qml/windowed/AppListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions qml/windowed/GridViewContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down