Commit d9c85361 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Quick Chat] Allow cycling through chats with Ctrl+(Shift)+Tab

This makes switching between conversations possible without using the mouse.

REVIEW: 128138
parent 2da2d251
......@@ -29,6 +29,8 @@ FocusScope {
property Conversation conv
signal closeRequested
signal previousConversationRequested
signal nextConversationRequested
RowLayout {
id: titleArea
......@@ -173,5 +175,17 @@ FocusScope {
chatWidget.closeRequested()
}
}
Keys.onPressed: {
if (event.modifiers & Qt.ControlModifier) {
if (event.key === Qt.Key_Tab) {
nextConversationRequested()
event.accepted = true
} else if (event.key === Qt.Key_Backtab) {
previousConversationRequested()
event.accepted = true
}
}
}
}
}
......@@ -43,7 +43,13 @@ ConversationDelegateButton {
base.currentIndex = -1
}
}
function openPreviousConversation() {
base.currentIndex = (base.currentIndex + conversationsView.count - 1) % conversationsView.count
}
function openNextConversation() {
base.currentIndex = (base.currentIndex + 1) % conversationsView.count
}
Component.onCompleted: setVisible(model.conversation.messages.shouldStartOpened)
PlasmaCore.Dialog {
......@@ -59,6 +65,8 @@ ConversationDelegateButton {
conv: model.conversation
onCloseRequested: closeConversation()
onPreviousConversationRequested: openPreviousConversation()
onNextConversationRequested: openNextConversation()
}
//if we are opening the dialog right away (e.g. started chat from pinned)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment