mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Add paging support
This commit is contained in:
parent
fa288b4015
commit
4eba21889d
@ -52,7 +52,8 @@ Item {
|
||||
background.backgroundImage = steamWorkshop.workshopListModel.getBannerUrl()
|
||||
banner.bannerPublishedFileID = steamWorkshop.workshopListModel.getBannerID()
|
||||
bannerTxtUnderline.numberSubscriber
|
||||
= steamWorkshop.workshopListModel.getBannerAmountSubscriber()
|
||||
= steamWorkshop.workshopListModel.getBannerAmountSubscriber(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +100,15 @@ Item {
|
||||
id: scrollView
|
||||
anchors.fill: parent
|
||||
contentWidth: parent.width
|
||||
contentHeight: gridView.height + header.height + 300
|
||||
contentHeight: gridView.height + header.height + 150
|
||||
|
||||
Behavior on contentHeight {
|
||||
PropertyAnimation {
|
||||
duration: 400
|
||||
property: "contentHeight"
|
||||
easing.type: Easing.InOutQuart
|
||||
}
|
||||
}
|
||||
|
||||
onContentYChanged: {
|
||||
// Calculate parallax scrolling
|
||||
@ -238,28 +247,36 @@ Item {
|
||||
cellHeight: 190
|
||||
height: contentHeight
|
||||
interactive: false
|
||||
|
||||
model: steamWorkshop.workshopListModel
|
||||
anchors {
|
||||
top: header.bottom
|
||||
topMargin: 100
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin: 50
|
||||
leftMargin: 45
|
||||
}
|
||||
|
||||
header: Item {
|
||||
height: 70
|
||||
width: parent.width
|
||||
width: gridView.width - gridView.anchors.leftMargin
|
||||
property alias searchField: tiSearch
|
||||
|
||||
Rectangle {
|
||||
color: Material.backgroundColor
|
||||
radius: 3
|
||||
width: parent.width - 10
|
||||
height: parent.height
|
||||
anchors.centerIn: parent
|
||||
|
||||
Item {
|
||||
id: searchWrapper
|
||||
|
||||
width: 400
|
||||
height: 50
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: 10
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@ -329,7 +346,7 @@ Item {
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
rightMargin: 50
|
||||
rightMargin: 10
|
||||
}
|
||||
|
||||
textRole: "text"
|
||||
@ -339,7 +356,7 @@ Item {
|
||||
font.family: ScreenPlay.settings.font
|
||||
onActivated: {
|
||||
steamWorkshop.workshopListModel.searchWorkshop(
|
||||
cbQuerySort.currentValue, 1)
|
||||
cbQuerySort.currentValue)
|
||||
}
|
||||
model: [{
|
||||
"value": SteamEnums.k_EUGCQuery_RankedByVote,
|
||||
@ -374,6 +391,7 @@ Item {
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
@ -396,6 +414,51 @@ Item {
|
||||
id: workshopScrollBar
|
||||
snapMode: ScrollBar.SnapOnRelease
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
height: 150
|
||||
width: parent.width
|
||||
spacing: 10
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Button {
|
||||
id: btnBack
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: qsTr("Back")
|
||||
enabled: steamWorkshop.workshopListModel.currentPage > 1
|
||||
onClicked: {
|
||||
steamWorkshop.workshopListModel.setCurrentPage(
|
||||
steamWorkshop.workshopListModel.currentPage - 1)
|
||||
steamWorkshop.workshopListModel.searchWorkshop(
|
||||
SteamEnums.K_EUGCQuery_RankedByTrend)
|
||||
}
|
||||
}
|
||||
Text {
|
||||
id: txtPage
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: steamWorkshop.workshopListModel.currentPage + "/"
|
||||
+ steamWorkshop.workshopListModel.pages
|
||||
font.family: ScreenPlay.settings.font
|
||||
color: Material.primaryTextColor
|
||||
}
|
||||
Button {
|
||||
id: btnForward
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: qsTr("Forward")
|
||||
enabled: steamWorkshop.workshopListModel.currentPage
|
||||
<= steamWorkshop.workshopListModel.pages - 1
|
||||
onClicked: {
|
||||
steamWorkshop.workshopListModel.setCurrentPage(
|
||||
steamWorkshop.workshopListModel.currentPage + 1)
|
||||
steamWorkshop.workshopListModel.searchWorkshop(
|
||||
SteamEnums.K_EUGCQuery_RankedByTrend)
|
||||
}
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user