113 lines
2.6 KiB
QML
Raw Normal View History

2019-07-29 19:48:22 +03:00
import QtQuick 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
2019-07-29 19:48:22 +03:00
import QtGraphicalEffects 1.12
2019-08-08 19:11:17 +03:00
Flickable {
2019-08-09 13:37:44 +03:00
id: userVewFlic
2019-08-08 19:11:17 +03:00
contentWidth: userVew.width
contentHeight: userVew.height
2019-08-09 13:37:44 +03:00
flickableDirection: Flickable.VerticalFlick;
2019-07-29 15:29:07 +03:00
property var model: null
2019-08-08 19:11:17 +03:00
signal tryConnect();
2019-08-08 19:11:17 +03:00
ScrollBar.vertical: ScrollBar {
width: metrix.pt
}
2019-08-08 19:11:17 +03:00
Item {
id: userVew
2019-07-29 19:48:22 +03:00
2019-08-09 13:37:44 +03:00
width: userVewFlic.width
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
ColumnLayout {
id: columnLayout
anchors.fill: parent
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
visible: (model)? !model.offline: false;
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
ImageView {
drawItem: "image://userItems/player/" + ((model)? model.id: -1).toString()
Layout.fillWidth: true
Layout.fillHeight: true
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
}
2019-08-08 19:11:17 +03:00
PropertyView {
Layout.fillWidth: true
keyText: qsTr("You ");
valueText : (model)? model.name: -1
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
}
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
PropertyView {
valueText : ((model)? model.gmail: -1).toString()
Layout.fillWidth: true
keyText: qsTr("You gmail");
}
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
PropertyView {
keyText: qsTr("Money ");
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
valueText : ((model)? model.money: -1).toString()
Layout.fillWidth: true
}
PropertyView {
keyText: qsTr("Record ");
valueText : ((model)? model.record: -1).toString()
Layout.fillWidth: true
}
PropertyView {
keyText: qsTr("AvgRecord ");
valueText : ((model)? model.avgRecord: -1).toString()
Layout.fillWidth: true
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
}
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
PropertyView {
keyText: qsTr("Snake ");
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
valueImage : "image://userItems/item/" + ((model)? model.cureentSnake: -1).toString()
Layout.fillWidth: true
}
2019-07-29 19:48:22 +03:00
}
2019-08-08 19:11:17 +03:00
ColumnLayout {
visible: (model)? model.offline: false;
anchors.fill: parent
Label {
wrapMode: Text.WordWrap
Layout.fillWidth: true
text: qsTr("Offline mode. Your statistics will be frozen until you login your profile.");
}
Button {
text: qsTr("try conect to server ");
Layout.alignment: Qt.AlignHCenter
2019-07-29 19:48:22 +03:00
2019-08-08 19:11:17 +03:00
onClicked: {
tryConnect();
}
}
Item {
Layout.fillHeight: true
}
}
}
}
2019-08-08 19:11:17 +03:00