mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
change short username to 14 characters, displaying as normal text
This commit is contained in:
parent
650b34c463
commit
028cce5394
2 changed files with 5 additions and 20 deletions
|
@ -134,8 +134,7 @@ Item {
|
|||
Text {
|
||||
id: loginText
|
||||
anchors.right: parent.right
|
||||
visible: !Account.loggedIn
|
||||
text: qsTr("Log in")
|
||||
text: Account.loggedIn ? tabletRoot.usernameShort : qsTr("Log in")
|
||||
horizontalAlignment: Text.AlignRight
|
||||
Layout.alignment: Qt.AlignRight
|
||||
font.pixelSize: 18
|
||||
|
@ -144,29 +143,15 @@ Item {
|
|||
}
|
||||
TextMetrics {
|
||||
id: loginTextMetrics
|
||||
text: Account.loggedIn ? tabletRoot.usernameShort : loginText.text
|
||||
text: loginText.text
|
||||
font: loginText.font
|
||||
}
|
||||
|
||||
HifiStylesUit.ShortcutText {
|
||||
anchors.right: parent.right
|
||||
visible: Account.loggedIn
|
||||
text: "<a href='https://highfidelity.com'>" + tabletRoot.usernameShort + "</a>"
|
||||
horizontalAlignment: Text.AlignRight
|
||||
Layout.alignment: Qt.AlignRight
|
||||
font.pixelSize: 18
|
||||
font.bold: true
|
||||
font.family: "Rawline"
|
||||
linkColor: hifi.colors.blueAccent
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (!Account.loggedIn) {
|
||||
DialogsManager.showLoginDialog();
|
||||
} else {
|
||||
Account.logOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,10 +178,10 @@ Rectangle {
|
|||
|
||||
function setUsername(newUsername) {
|
||||
username = newUsername;
|
||||
usernameShort = newUsername.substring(0, 8);
|
||||
usernameShort = newUsername.substring(0, 14);
|
||||
|
||||
if (newUsername.length > 8) {
|
||||
usernameShort = usernameShort + "..."
|
||||
if (newUsername.length > 14) {
|
||||
usernameShort = usernameShort + "..."
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue