Skip to content
Snippets Groups Projects
Commit 855b0233 authored by Liam Coursodon's avatar Liam Coursodon
Browse files

TextEdit: disable persistent mode and made right clickable the text

Change-Id: If8f92dfdba20005fe8430bfbe880167061301b95
parent a0f0dd13
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ TextField { ...@@ -36,6 +36,7 @@ TextField {
} }
signal keyPressed signal keyPressed
signal rejected
property bool inputIsValid: true property bool inputIsValid: true
...@@ -87,6 +88,9 @@ TextField { ...@@ -87,6 +88,9 @@ TextField {
root.accepted(); root.accepted();
} }
event.accepted = true; event.accepted = true;
} else if (event.key === Qt.Key_Escape) {
root.focus = false;
root.rejected();
} else { } else {
root.keyPressed(); root.keyPressed();
} }
......
...@@ -122,6 +122,10 @@ Loader { ...@@ -122,6 +122,10 @@ Loader {
echoMode: root.echoMode echoMode: root.echoMode
placeholderText: root.placeholderText placeholderText: root.placeholderText
onAccepted: root.accepted() onAccepted: root.accepted()
onRejected: {
root.editMode = false;
text = staticText;
}
onKeyPressed: root.keyPressed() onKeyPressed: root.keyPressed()
onTextChanged: dynamicText = text onTextChanged: dynamicText = text
text: staticText text: staticText
......
...@@ -51,7 +51,6 @@ Rectangle { ...@@ -51,7 +51,6 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
height: headerRow.implicitHeight + JamiTheme.preferredMarginSize + settingsTabButton.height height: headerRow.implicitHeight + JamiTheme.preferredMarginSize + settingsTabButton.height
RowLayout { RowLayout {
id: headerRow id: headerRow
spacing: 15 spacing: 15
...@@ -105,7 +104,7 @@ Rectangle { ...@@ -105,7 +104,7 @@ Rectangle {
} }
editMode: false editMode: false
isPersistent: false
placeholderText: JamiStrings.title placeholderText: JamiStrings.title
onActiveFocusChanged: { onActiveFocusChanged: {
...@@ -148,7 +147,6 @@ Rectangle { ...@@ -148,7 +147,6 @@ Rectangle {
onAccepted: ConversationsAdapter.updateConversationDescription(LRCInstance.selectedConvUid, dynamicText) onAccepted: ConversationsAdapter.updateConversationDescription(LRCInstance.selectedConvUid, dynamicText)
editMode: false editMode: false
isPersistent: false
onActiveFocusChanged: { onActiveFocusChanged: {
if (!activeFocus) { if (!activeFocus) {
......
...@@ -76,16 +76,13 @@ SettingsPageBase { ...@@ -76,16 +76,13 @@ SettingsPageBase {
font.pixelSize: JamiTheme.materialLineEditPixelSize font.pixelSize: JamiTheme.materialLineEditPixelSize
} }
maxCharacters: JamiTheme.maximumCharacters
placeholderText: JamiStrings.displayName
editMode: false
isPersistent: false
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight + 8 Layout.preferredHeight: JamiTheme.preferredFieldHeight + 8
Layout.fillWidth: true Layout.fillWidth: true
maxCharacters: JamiTheme.maximumCharacters
placeholderText: JamiStrings.displayName
staticText: CurrentAccount.alias staticText: CurrentAccount.alias
elidedText: displayNameLineEditTextSize.elidedText elidedText: displayNameLineEditTextSize.elidedText
......
...@@ -78,7 +78,6 @@ RowLayout { ...@@ -78,7 +78,6 @@ RowLayout {
} }
editMode: false editMode: false
isPersistent: false
onActiveFocusChanged: { onActiveFocusChanged: {
if (!activeFocus) { if (!activeFocus) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment