1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00
ScreenPlay/ScreenPlayWorkshop/qml/Navigation.qml

119 lines
2.7 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
2021-07-15 12:07:39 +02:00
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl
import ScreenPlayWorkshop
2020-08-20 17:21:09 +02:00
Rectangle {
2020-08-20 17:21:09 +02:00
id: root
property SteamWorkshop steam
2021-02-13 20:17:16 +01:00
signal uploadPressed
2021-05-16 19:37:55 +02:00
implicitWidth: 800
height: 50
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
height: 50
2021-05-16 19:37:55 +02:00
2020-08-20 17:21:09 +02:00
anchors {
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
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
target: steam.steamAccount
2020-08-20 17:21:09 +02:00
}
}
2021-05-16 19:37:55 +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 {
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
}
}
]
}