2021-09-10 12:45:15 +02:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Material
|
2021-07-15 12:07:39 +02:00
|
|
|
import Qt5Compat.GraphicalEffects
|
2021-09-10 12:45:15 +02:00
|
|
|
import QtQuick.Layouts
|
2022-05-05 13:02:54 +02:00
|
|
|
import ScreenPlayWorkshop
|
2021-06-25 12:07:28 +02:00
|
|
|
import "upload/"
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
2023-06-02 10:19:12 +02:00
|
|
|
objectName: "WorkshopProfilePage"
|
2021-06-25 12:07:28 +02:00
|
|
|
|
2021-09-23 15:55:40 +02:00
|
|
|
property ScreenPlayWorkshop screenPlayWorkshop
|
|
|
|
property SteamWorkshop steamWorkshop
|
2023-06-02 10:19:12 +02:00
|
|
|
property StackView stackView
|
|
|
|
StackView.onActivated: steamWorkshop.requestUserItems()
|
2021-06-25 12:07:28 +02:00
|
|
|
|
|
|
|
Flickable {
|
|
|
|
id: scrollView
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
contentWidth: root.width
|
|
|
|
contentHeight: gridView.height + header.height + 150
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: header
|
|
|
|
height: 200
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
leftMargin: 45
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: 20
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
}
|
|
|
|
spacing: 20
|
2023-06-02 10:19:12 +02:00
|
|
|
SteamProfilePicture {
|
2021-06-25 12:07:28 +02:00
|
|
|
id: avatar
|
|
|
|
|
|
|
|
width: 70
|
|
|
|
height: 70
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
2021-09-23 15:55:40 +02:00
|
|
|
text: root.steamWorkshop.steamAccount.username
|
2021-06-25 12:07:28 +02:00
|
|
|
font.pointSize: 12
|
|
|
|
color: "white"
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: qsTr("Back")
|
2023-06-02 10:19:12 +02:00
|
|
|
onClicked: {
|
|
|
|
stackView.pop();
|
|
|
|
}
|
2021-06-25 12:07:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GridView {
|
|
|
|
id: gridView
|
|
|
|
|
|
|
|
maximumFlickVelocity: 7000
|
|
|
|
flickDeceleration: 5000
|
|
|
|
cellWidth: 330
|
|
|
|
cellHeight: 190
|
|
|
|
height: contentHeight
|
|
|
|
interactive: false
|
2021-09-23 15:55:40 +02:00
|
|
|
model: root.steamWorkshop.workshopProfileListModel
|
2021-06-25 12:07:28 +02:00
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
top: header.bottom
|
|
|
|
topMargin: 40
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
leftMargin: 45
|
|
|
|
}
|
|
|
|
|
|
|
|
delegate: WorkshopItem {
|
|
|
|
imgUrl: m_workshopPreview
|
|
|
|
name: m_workshopTitle
|
|
|
|
publishedFileID: m_publishedFileID
|
|
|
|
additionalPreviewUrl: m_additionalPreviewUrl
|
|
|
|
subscriptionCount: m_subscriptionCount
|
|
|
|
itemIndex: index
|
2021-09-23 15:55:40 +02:00
|
|
|
steamWorkshop: root.steamWorkshop
|
2021-06-25 12:07:28 +02:00
|
|
|
// onClicked: {
|
|
|
|
// sidebar.setWorkshopItem(publishedFileID, imgUrl,
|
|
|
|
// additionalPreviewUrl,
|
|
|
|
// subscriptionCount)
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
|
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")
|
2021-09-23 15:55:40 +02:00
|
|
|
enabled: root.steamWorkshop.workshopProfileListModel.currentPage > 1
|
2021-06-25 12:07:28 +02:00
|
|
|
onClicked: {
|
2023-02-02 15:25:26 +01:00
|
|
|
root.steamWorkshop.workshopProfileListModel.setCurrentPage(root.steamWorkshop.workshopProfileListModel.currentPage - 1);
|
2021-06-25 12:07:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: txtPage
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2023-02-02 15:25:26 +01:00
|
|
|
text: root.steamWorkshop.workshopProfileListModel.currentPage + "/" + root.steamWorkshop.workshopProfileListModel.pages
|
2021-06-25 12:07:28 +02:00
|
|
|
color: Material.primaryTextColor
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: btnForward
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
text: qsTr("Forward")
|
2023-02-02 15:25:26 +01:00
|
|
|
enabled: root.steamWorkshop.workshopProfileListModel.currentPage <= root.steamWorkshop.workshopProfileListModel.pages - 1
|
2021-06-25 12:07:28 +02:00
|
|
|
onClicked: {
|
2023-02-02 15:25:26 +01:00
|
|
|
root.steamWorkshop.workshopProfileListModel.setCurrentPage(root.steamWorkshop.workshopProfileListModel.currentPage + 1);
|
2021-06-25 12:07:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|