Corrected newline inserting when using shift+return while writing SMS messages
Shift+return was always inserting newline at the end of the current line of text, ignoring where the cursor was, and not overriding currently selected text BUG: 488585
This commit is contained in:
parent
0a0ad1b439
commit
d03e964ed7
1 changed files with 3 additions and 1 deletions
|
@ -84,7 +84,9 @@ ColumnLayout {
|
||||||
Keys.onReturnPressed: event => {
|
Keys.onReturnPressed: event => {
|
||||||
if (event.key === Qt.Key_Return) {
|
if (event.key === Qt.Key_Return) {
|
||||||
if (event.modifiers & Qt.ShiftModifier) {
|
if (event.modifiers & Qt.ShiftModifier) {
|
||||||
messageField.append("")
|
//remove any selected text and insert new line at cursor position
|
||||||
|
messageField.cursorSelection.text = ""
|
||||||
|
messageField.insert(messageField.cursorPosition,"\n")
|
||||||
} else {
|
} else {
|
||||||
sendButton.clicked()
|
sendButton.clicked()
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
|
|
Loading…
Reference in a new issue