smsapp/qml: Define explicit params in signal handlers

This commit is contained in:
Mike Noe 2024-03-11 19:49:45 -04:00
parent 705a72c077
commit 6c777875ff
3 changed files with 4 additions and 4 deletions

View file

@ -76,7 +76,7 @@ Item {
contextMenu.open(); contextMenu.open();
} }
} }
onPressAndHold: { onPressAndHold: mouse => {
var selectStart = messageLabel.selectionStart; var selectStart = messageLabel.selectionStart;
var selectEnd = messageLabel.selectionEnd; var selectEnd = messageLabel.selectionEnd;
selectedText = messageLabel.selectedText; selectedText = messageLabel.selectedText;

View file

@ -125,11 +125,11 @@ Kirigami.ScrollablePage
view.currentIndex = 0 view.currentIndex = 0
filter.forceActiveFocus(); filter.forceActiveFocus();
} }
Keys.onReturnPressed: { Keys.onReturnPressed: event => {
event.accepted = true event.accepted = true
view.currentItem.startChat() view.currentItem.startChat()
} }
Keys.onEscapePressed: { Keys.onEscapePressed: event => {
event.accepted = filter.text != "" event.accepted = filter.text != ""
filter.text = "" filter.text = ""
} }

View file

@ -83,7 +83,7 @@ ColumnLayout {
cursorShape: Qt.IBeamCursor cursorShape: Qt.IBeamCursor
z: 1 z: 1
} }
Keys.onReturnPressed: { 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("") messageField.append("")