mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 07:25:43 +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 {
|
Text {
|
||||||
id: loginText
|
id: loginText
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
visible: !Account.loggedIn
|
text: Account.loggedIn ? tabletRoot.usernameShort : qsTr("Log in")
|
||||||
text: qsTr("Log in")
|
|
||||||
horizontalAlignment: Text.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
font.pixelSize: 18
|
font.pixelSize: 18
|
||||||
|
@ -144,29 +143,15 @@ Item {
|
||||||
}
|
}
|
||||||
TextMetrics {
|
TextMetrics {
|
||||||
id: loginTextMetrics
|
id: loginTextMetrics
|
||||||
text: Account.loggedIn ? tabletRoot.usernameShort : loginText.text
|
text: loginText.text
|
||||||
font: loginText.font
|
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 {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!Account.loggedIn) {
|
if (!Account.loggedIn) {
|
||||||
DialogsManager.showLoginDialog();
|
DialogsManager.showLoginDialog();
|
||||||
} else {
|
|
||||||
Account.logOut();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,9 +178,9 @@ Rectangle {
|
||||||
|
|
||||||
function setUsername(newUsername) {
|
function setUsername(newUsername) {
|
||||||
username = newUsername;
|
username = newUsername;
|
||||||
usernameShort = newUsername.substring(0, 8);
|
usernameShort = newUsername.substring(0, 14);
|
||||||
|
|
||||||
if (newUsername.length > 8) {
|
if (newUsername.length > 14) {
|
||||||
usernameShort = usernameShort + "..."
|
usernameShort = usernameShort + "..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue