Skip to content
Snippets Groups Projects
Commit e5bafb54 authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk
Browse files

settings: make user registered name and id elide correctly

Change-Id: I04250ff2fc61015e1e36ac2d728a69914958122c
parent a79bf21a
No related branches found
No related tags found
No related merge requests found
...@@ -56,13 +56,17 @@ ColumnLayout { ...@@ -56,13 +56,17 @@ ColumnLayout {
} }
// Identity // Identity
RowLayout { Row {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight
spacing: width - idLabel.width - currentRingID.width
Label { Label {
id: idLabel id: idLabel
anchors.verticalCenter: parent.verticalCenter
text: JamiStrings.identifier text: JamiStrings.identifier
font.pointSize: JamiTheme.settingsFontSize font.pointSize: JamiTheme.settingsFontSize
font.kerning: true font.kerning: true
...@@ -77,12 +81,15 @@ ColumnLayout { ...@@ -77,12 +81,15 @@ ColumnLayout {
property var backgroundColor: "transparent" property var backgroundColor: "transparent"
property var borderColor: "transparent" property var borderColor: "transparent"
Layout.fillWidth: true anchors.verticalCenter: parent.verticalCenter
height: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.textFontSize font.pointSize: JamiTheme.textFontSize
font.kerning: true font.kerning: true
font.bold: true font.bold: true
padding: 0
readOnly: true readOnly: true
selectByMouse: true selectByMouse: true
...@@ -102,35 +109,49 @@ ColumnLayout { ...@@ -102,35 +109,49 @@ ColumnLayout {
TextMetrics { TextMetrics {
id: currentRingIDText id: currentRingIDText
font: currentRingID.font
elide: Text.ElideRight elide: Text.ElideRight
elideWidth: root.width - idLabel.width -JamiTheme.preferredMarginSize*4 elideWidth: root.width - idLabel.width -
JamiTheme.preferredMarginSize * 4
text: SettingsAdapter.getCurrentAccount_Profile_Info_Uri() text: SettingsAdapter.getCurrentAccount_Profile_Info_Uri()
} }
} }
} }
RowLayout { Row {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel { spacing: width - lblRegisteredName.width - currentRegisteredID.width
Layout.fillWidth: true
Label {
id: lblRegisteredName
anchors.verticalCenter: parent.verticalCenter
eText: JamiStrings.username text: JamiStrings.username
fontSize: JamiTheme.settingsFontSize font.pointSize: JamiTheme.settingsFontSize
maxWidth: width font.kerning: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
} }
UsernameLineEdit { UsernameLineEdit {
id: currentRegisteredID id: currentRegisteredID
Layout.alignment: Qt.AlignRight anchors.verticalCenter: parent.verticalCenter
Layout.fillWidth: true
Layout.preferredWidth: itemWidth
implicitWidth: itemWidth
wrapMode: Text.NoWrap
height: JamiTheme.preferredFieldHeight
width: {
var maximumWidth = parent.width - lblRegisteredName.width
- JamiTheme.preferredMarginSize
return fieldLayoutWidth < maximumWidth ?
fieldLayoutWidth : maximumWidth
}
wrapMode: Text.NoWrap
placeholderText: registeredIdNeedsSet ? placeholderText: registeredIdNeedsSet ?
JamiStrings.registerUsername : "" JamiStrings.registerUsername : ""
text: { text: {
...@@ -170,4 +191,4 @@ ColumnLayout { ...@@ -170,4 +191,4 @@ ColumnLayout {
onClicked: nameRegistrationDialog.openNameRegistrationDialog(currentRegisteredID.text) onClicked: nameRegistrationDialog.openNameRegistrationDialog(currentRegisteredID.text)
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment