2023-04-09 05:35:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-03-20 06:53:56 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
2023-05-19 02:08:36 +00:00
|
|
|
import Fk
|
2023-12-10 10:55:16 +00:00
|
|
|
import Fk.Common
|
2023-03-20 06:53:56 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
width: bg.width
|
|
|
|
height: bg.height
|
|
|
|
|
2023-12-28 04:11:24 +00:00
|
|
|
Rectangle {
|
|
|
|
x: 84; y: 31.6
|
|
|
|
height: 20
|
|
|
|
width: childrenRect.width + 48
|
|
|
|
|
|
|
|
gradient: Gradient {
|
|
|
|
orientation: Gradient.Horizontal
|
|
|
|
GradientStop { position: 0.7; color: "#AA3598E8" }
|
|
|
|
GradientStop { position: 1.0; color: "transparent" }
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: {
|
|
|
|
config.totalTime;
|
|
|
|
const gamedata = JSON.parse(Backend.callLuaFunction("GetPlayerGameData", [Self.id]));
|
|
|
|
const totalTime = gamedata[3];
|
|
|
|
const h = (totalTime / 3600).toFixed(2);
|
|
|
|
const m = Math.floor(totalTime / 60);
|
|
|
|
if (m < 100) {
|
|
|
|
return Backend.translate("TotalGameTime: %1 min").arg(m);
|
|
|
|
} else {
|
|
|
|
return Backend.translate("TotalGameTime: %1 h").arg(h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
x: 12; y: 1
|
|
|
|
font.family: fontLibian.name
|
|
|
|
font.pixelSize: 16
|
|
|
|
color: "white"
|
|
|
|
//style: Text.Outline
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-20 06:53:56 +00:00
|
|
|
Image {
|
|
|
|
id: bg
|
|
|
|
x: -32
|
|
|
|
height: 69
|
|
|
|
source: SkinBank.LOBBY_IMG_DIR + "profile"
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Item { Layout.preferredWidth: 16 }
|
|
|
|
|
2023-12-10 10:55:16 +00:00
|
|
|
Avatar {
|
2023-03-20 06:53:56 +00:00
|
|
|
Layout.preferredWidth: 64
|
|
|
|
Layout.preferredHeight: 64
|
2023-12-10 10:55:16 +00:00
|
|
|
general: Self.avatar
|
2023-03-20 06:53:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Item { Layout.preferredWidth: 8 }
|
|
|
|
|
|
|
|
Text {
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
text: Self.screenName
|
|
|
|
font.pixelSize: 22
|
|
|
|
font.family: fontLibian.name
|
|
|
|
color: "#F0DFAF"
|
|
|
|
style: Text.Outline
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TapHandler {
|
2023-08-03 07:24:17 +00:00
|
|
|
gesturePolicy: TapHandler.WithinBounds
|
|
|
|
|
2023-03-20 06:53:56 +00:00
|
|
|
onTapped: {
|
2023-05-20 08:00:03 +00:00
|
|
|
lobby_dialog.sourceComponent = Qt.createComponent("EditProfile.qml");
|
2023-03-20 06:53:56 +00:00
|
|
|
lobby_drawer.open();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|