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.Controls.Material.impl
|
2022-05-05 13:02:54 +02:00
|
|
|
import ScreenPlayWorkshop
|
2020-08-20 17:21:09 +02:00
|
|
|
|
2021-02-05 11:48:06 +01:00
|
|
|
Rectangle {
|
2020-08-20 17:21:09 +02:00
|
|
|
id: root
|
|
|
|
|
2021-05-23 17:23:59 +02:00
|
|
|
property SteamWorkshop steam
|
2021-02-13 20:17:16 +01:00
|
|
|
|
2021-05-23 17:23:59 +02:00
|
|
|
signal uploadPressed
|
2021-05-16 19:37:55 +02:00
|
|
|
|
|
|
|
implicitWidth: 800
|
|
|
|
height: 50
|
2021-02-05 11:48:06 +01:00
|
|
|
color: Material.theme === Material.Light ? "white" : Material.background
|
2020-08-20 17:21:09 +02:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: wrapper
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-02-05 11:48:06 +01:00
|
|
|
height: 50
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
anchors {
|
2021-02-05 11:48:06 +01:00
|
|
|
verticalCenter: parent.verticalCenter
|
2020-08-20 17:21:09 +02:00
|
|
|
right: parent.right
|
|
|
|
left: parent.left
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: name
|
|
|
|
|
|
|
|
font.pointSize: 14
|
|
|
|
color: Material.primaryTextColor
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2021-05-16 19:37:55 +02:00
|
|
|
text: {
|
2023-02-02 15:25:26 +01:00
|
|
|
return steam.steamAccount.username + qsTr(" Subscribed items: ") + steam.steamAccount.amountSubscribedItems;
|
2021-05-16 19:37:55 +02:00
|
|
|
}
|
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
left: avatar.right
|
|
|
|
leftMargin: 10
|
|
|
|
bottom: parent.bottom
|
|
|
|
right: btnUplaod.left
|
|
|
|
rightMargin: 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SteamImage {
|
|
|
|
id: avatar
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-02-05 11:48:06 +01:00
|
|
|
width: 30
|
|
|
|
height: 30
|
2021-05-16 19:37:55 +02:00
|
|
|
Component.onCompleted: {
|
2023-02-02 15:25:26 +01:00
|
|
|
steam.steamAccount.loadAvatar();
|
2021-05-16 19:37:55 +02:00
|
|
|
}
|
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: 10
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
Connections {
|
|
|
|
function onAvatarChanged(_avatar) {
|
2023-02-02 15:25:26 +01:00
|
|
|
avatar.setImage(_avatar);
|
|
|
|
avatarPlaceholder.opacity = 0;
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-05-23 17:23:59 +02:00
|
|
|
target: steam.steamAccount
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
2021-05-23 17:23:59 +02:00
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-05-23 17:23:59 +02:00
|
|
|
Image {
|
|
|
|
id: avatarPlaceholder
|
|
|
|
anchors.fill: avatar
|
2022-05-01 20:20:57 +02:00
|
|
|
source: "qrc:/qml/ScreenPlayWorkshop/assets/images/steam_default_avatar.png"
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: btnUplaod
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
text: qsTr("Upload to the Steam Workshop")
|
2022-05-01 20:20:57 +02:00
|
|
|
icon.source: "qrc:/qml/ScreenPlayWorkshop/assets/icons/icon_plus.svg"
|
2020-08-20 17:21:09 +02:00
|
|
|
icon.color: "white"
|
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
|
|
|
onClicked: uploadPressed()
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
anchors {
|
2021-02-05 11:48:06 +01:00
|
|
|
verticalCenter: parent.verticalCenter
|
2020-08-20 17:21:09 +02:00
|
|
|
right: parent.right
|
|
|
|
rightMargin: 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
states: [
|
|
|
|
State {
|
|
|
|
name: "base"
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyChanges {
|
|
|
|
target: bg
|
|
|
|
radius: 3
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "scrolling"
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyChanges {
|
|
|
|
target: bg
|
|
|
|
radius: 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|