Jump to bottom and mark messages read with Escape
Pressing the Escape key again when you're already at the bottom and there are no unread messages takes you back to the room list like before.
This commit is contained in:
@@ -77,7 +77,14 @@ Kirigami.ScrollablePage {
|
||||
|
||||
Shortcut {
|
||||
sequence: StandardKey.Cancel
|
||||
onActivated: applicationWindow().pageStack.get(0).forceActiveFocus()
|
||||
onActivated: {
|
||||
if (!messageListView.atYEnd || currentRoom.hasUnreadMessages) {
|
||||
goToLastMessage();
|
||||
currentRoom.markAllMessagesAsRead();
|
||||
} else {
|
||||
applicationWindow().pageStack.get(0).forceActiveFocus();
|
||||
}
|
||||
}
|
||||
enabled: !page.disableCancelShortcut
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user