Add grid scrolling to ProviderBrowse view
This commit is contained in:
@@ -5,23 +5,33 @@ import QtQuick.Controls 2.15
|
||||
|
||||
import Ikinuki.Client 1.0
|
||||
|
||||
Grid {
|
||||
ScrollView {
|
||||
id: root
|
||||
clip: true
|
||||
property bool selected
|
||||
property int yIndex: 0
|
||||
property int xIndex: 0
|
||||
property int scrollIndex: 0
|
||||
property int numColumns: 6
|
||||
property var provider
|
||||
property var shows: []
|
||||
columns: numColumns
|
||||
topPadding: 20
|
||||
Repeater {
|
||||
id: repeater
|
||||
model: shows
|
||||
BrowseShow {
|
||||
show: provider.getShow(modelData)
|
||||
elemSelected: selected && (index == (yIndex * numColumns + xIndex))
|
||||
property var shows
|
||||
contentHeight: Math.floor(shows.length / numColumns) * 400
|
||||
ScrollBar.vertical.position: scrollIndex / Math.floor(shows.length / numColumns)
|
||||
Behavior on ScrollBar.vertical.position {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.Linear
|
||||
}
|
||||
}
|
||||
Grid {
|
||||
columns: numColumns
|
||||
topPadding: 20
|
||||
Repeater {
|
||||
id: repeater
|
||||
model: shows
|
||||
BrowseShow {
|
||||
show: provider.getShow(modelData)
|
||||
elemSelected: selected && (index == (yIndex * numColumns + xIndex))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user