Skip to content
Snippets Groups Projects
Commit bad5698e authored by Fadi Shehadeh's avatar Fadi Shehadeh Committed by François-Simon Fauteux-Chapleau
Browse files

RTL: JamiIdentifier layout fix

Adapted radius for RTL.

GitLab: #1953
Change-Id: I732cd33b403fea1f115527db19faffe131b259eb
parent 7f0a94dd
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ Item { ...@@ -32,7 +32,7 @@ Item {
property bool validated: false property bool validated: false
property bool outsideClic: false property bool outsideClic: false
property bool justChanged: false property bool justChanged: false
property bool clic : false property bool clic: false
height: getHeight() height: getHeight()
function getHeight() { function getHeight() {
...@@ -45,7 +45,6 @@ Item { ...@@ -45,7 +45,6 @@ Item {
if (usernameTextEdit.editMode) { if (usernameTextEdit.editMode) {
usernameTextEdit.editMode = false; usernameTextEdit.editMode = false;
} }
} }
} }
...@@ -57,10 +56,16 @@ Item { ...@@ -57,10 +56,16 @@ Item {
RoundedBorderRectangle { RoundedBorderRectangle {
id: leftRect id: leftRect
fillColor: JamiTheme.jamiIdBackgroundColor fillColor: JamiTheme.jamiIdBackgroundColor
Layout.preferredWidth: usernameTextEdit.visible ? childrenRect.width + JamiTheme.pushButtonMargins : childrenRect.width Layout.preferredWidth: usernameTextEdit.visible ? childrenRect.width + JamiTheme.pushButtonMargins : childrenRect.width
Layout.preferredHeight: childrenRect.height Layout.preferredHeight: childrenRect.height
radius: { radius: isRTL ? {
"tl": 0,
"tr": 5,
"br": 5,
"bl": 0
} : {
"tl": 5, "tl": 5,
"tr": 0, "tr": 0,
"br": 0, "br": 0,
...@@ -105,7 +110,7 @@ Item { ...@@ -105,7 +110,7 @@ Item {
dynamicText = ''; dynamicText = '';
} }
} }
Label{ Label {
id: usernameLabel id: usernameLabel
visible: !usernameTextEdit.editMode visible: !usernameTextEdit.editMode
...@@ -118,7 +123,7 @@ Item { ...@@ -118,7 +123,7 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
elide: Text.ElideRight elide: Text.ElideRight
color: JamiTheme.tintedBlue color: JamiTheme.tintedBlue
font.pixelSize : text.length > 16 ? JamiTheme.jamiIdSmallFontSize : JamiTheme.bigFontSize font.pixelSize: text.length > 16 ? JamiTheme.jamiIdSmallFontSize : JamiTheme.bigFontSize
property string registeredName: CurrentAccount.registeredName property string registeredName: CurrentAccount.registeredName
property string infohash: CurrentAccount.uri property string infohash: CurrentAccount.uri
text: (btnId.clicked && registeredName) ? registeredName : infohash text: (btnId.clicked && registeredName) ? registeredName : infohash
...@@ -132,7 +137,12 @@ Item { ...@@ -132,7 +137,12 @@ Item {
Layout.preferredWidth: childrenRect.width + 2 * JamiTheme.pushButtonMargins Layout.preferredWidth: childrenRect.width + 2 * JamiTheme.pushButtonMargins
Layout.preferredHeight: leftRect.height Layout.preferredHeight: leftRect.height
radius: { radius: isRTL ? {
"tl": 5,
"tr": 0,
"br": 0,
"bl": 5
} : {
"tl": 0, "tl": 0,
"tr": 5, "tr": 5,
"br": 5, "br": 5,
...@@ -228,10 +238,14 @@ Item { ...@@ -228,10 +238,14 @@ Item {
toolTipText: JamiStrings.identifierURI toolTipText: JamiStrings.identifierURI
onClicked: { onClicked: {
if (clicked) { if (clicked) {
usernameTextEdit.staticText = Qt.binding(function() {return CurrentAccount.uri} ); usernameTextEdit.staticText = Qt.binding(function () {
return CurrentAccount.uri;
});
btnId.toolTipText = JamiStrings.identifierRegisterName; btnId.toolTipText = JamiStrings.identifierRegisterName;
} else { } else {
usernameTextEdit.staticText = Qt.binding(function() {return CurrentAccount.registeredName} ); usernameTextEdit.staticText = Qt.binding(function () {
return CurrentAccount.registeredName;
});
btnId.toolTipText = JamiStrings.identifierURI; btnId.toolTipText = JamiStrings.identifierURI;
} }
clicked = !clicked; clicked = !clicked;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment