Add grid scrolling to ProviderBrowse view

This commit is contained in:
2022-09-13 16:48:27 -06:00
parent e7004594fe
commit 1e7d9db9cc
2 changed files with 35 additions and 14 deletions
@@ -27,9 +27,9 @@ Rectangle {
width: parent.width
}
CoverGrid {
id: coverGrid
height: parent.height - 80
width: parent.width
id: coverGrid
provider: root.provider
shows: root.provider.showsAlphabetic
selected: currentView == 0
@@ -62,9 +62,20 @@ Rectangle {
coverGrid.xIndex++;
}
} else if (event.key == Qt.Key_Down) {
coverGrid.yIndex++;
var max = Math.floor(coverGrid.shows.length / coverGrid.numColumns);
if (coverGrid.yIndex < max) {
coverGrid.yIndex++;
if (coverGrid.scrollIndex < coverGrid.yIndex - 1.5) {
coverGrid.scrollIndex++;
}
}
} else if (event.key == Qt.Key_Up) {
coverGrid.yIndex--;
if (coverGrid.yIndex > 0) {
coverGrid.yIndex--;
if (coverGrid.scrollIndex > coverGrid.yIndex + 0.5) {
coverGrid.scrollIndex--;
}
}
}
} else if (currentView == 1) { // alphabet
if (event.key == Qt.Key_Left) {