FreeKill/Fk/LobbyElement/UserInfo.qml

96 lines
1.8 KiB
QML
Raw Normal View History

2023-04-28 10:24:31 +00:00
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
ColumnLayout {
// anchors.centerIn: parent
RowLayout {
anchors.rightMargin: 8
spacing: 16
Text {
text: luatr("Username")
2023-04-28 10:24:31 +00:00
}
Text {
text: Self.screenName
font.pixelSize: 18
}
}
Timer {
id: opTimer
interval: 1000
}
2023-04-28 10:24:31 +00:00
RowLayout {
anchors.rightMargin: 8
spacing: 16
Text {
text: luatr("Avatar")
2023-04-28 10:24:31 +00:00
}
TextField {
id: avatarName
maximumLength: 64
2023-04-28 10:24:31 +00:00
font.pixelSize: 18
text: Self.avatar
2023-10-27 14:53:25 +00:00
Layout.fillWidth: true
2023-04-28 10:24:31 +00:00
}
Button {
text: luatr("Update Avatar")
enabled: avatarName.text !== "" && !opTimer.running
2023-04-28 10:24:31 +00:00
onClicked: {
mainWindow.busy = true;
opTimer.start();
2023-04-28 10:24:31 +00:00
ClientInstance.notifyServer(
"UpdateAvatar",
JSON.stringify([avatarName.text])
);
}
}
}
RowLayout {
anchors.rightMargin: 8
spacing: 16
Text {
text: luatr("Old Password")
2023-04-28 10:24:31 +00:00
}
TextField {
id: oldPassword
echoMode: TextInput.Password
passwordCharacter: "*"
2023-10-27 14:53:25 +00:00
Layout.rightMargin: 16
Layout.fillWidth: true
2023-04-28 10:24:31 +00:00
}
}
RowLayout {
anchors.rightMargin: 8
spacing: 16
Text {
text: luatr("New Password")
2023-04-28 10:24:31 +00:00
}
TextField {
id: newPassword
echoMode: TextInput.Password
passwordCharacter: "*"
2023-10-27 14:53:25 +00:00
Layout.fillWidth: true
2023-04-28 10:24:31 +00:00
}
Button {
text: luatr("Update Password")
enabled: oldPassword.text !== "" && newPassword.text !== ""
&& !opTimer.running
2023-04-28 10:24:31 +00:00
onClicked: {
mainWindow.busy = true;
opTimer.start();
2023-04-28 10:24:31 +00:00
ClientInstance.notifyServer(
"UpdatePassword",
JSON.stringify([oldPassword.text, newPassword.text])
);
}
}
}
}