TextEdit: disable persistent mode and made right clickable the text

Change-Id: If8f92dfdba20005fe8430bfbe880167061301b95
This commit is contained in:
lcoursodon
2023-11-07 15:53:05 -05:00
parent a0f0dd132a
commit 855b023349
5 changed files with 12 additions and 10 deletions

View File

@@ -36,6 +36,7 @@ TextField {
}
signal keyPressed
signal rejected
property bool inputIsValid: true
@@ -87,6 +88,9 @@ TextField {
root.accepted();
}
event.accepted = true;
} else if (event.key === Qt.Key_Escape) {
root.focus = false;
root.rejected();
} else {
root.keyPressed();
}

View File

@@ -122,6 +122,10 @@ Loader {
echoMode: root.echoMode
placeholderText: root.placeholderText
onAccepted: root.accepted()
onRejected: {
root.editMode = false;
text = staticText;
}
onKeyPressed: root.keyPressed()
onTextChanged: dynamicText = text
text: staticText

View File

@@ -51,7 +51,6 @@ Rectangle {
anchors.right: parent.right
height: headerRow.implicitHeight + JamiTheme.preferredMarginSize + settingsTabButton.height
RowLayout {
id: headerRow
spacing: 15
@@ -105,7 +104,7 @@ Rectangle {
}
editMode: false
isPersistent: false
placeholderText: JamiStrings.title
onActiveFocusChanged: {
@@ -148,7 +147,6 @@ Rectangle {
onAccepted: ConversationsAdapter.updateConversationDescription(LRCInstance.selectedConvUid, dynamicText)
editMode: false
isPersistent: false
onActiveFocusChanged: {
if (!activeFocus) {

View File

@@ -76,16 +76,13 @@ SettingsPageBase {
font.pixelSize: JamiTheme.materialLineEditPixelSize
}
maxCharacters: JamiTheme.maximumCharacters
placeholderText: JamiStrings.displayName
editMode: false
isPersistent: false
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight + 8
Layout.fillWidth: true
maxCharacters: JamiTheme.maximumCharacters
placeholderText: JamiStrings.displayName
staticText: CurrentAccount.alias
elidedText: displayNameLineEditTextSize.elidedText

View File

@@ -78,7 +78,6 @@ RowLayout {
}
editMode: false
isPersistent: false
onActiveFocusChanged: {
if (!activeFocus) {