diff options
-rw-r--r-- | qml/ChatPage.qml | 4 | ||||
-rw-r--r-- | qml/ChatlistPage.qml | 1 | ||||
-rw-r--r-- | qml/ComposePane.qml | 33 | ||||
-rw-r--r-- | qml/main.qml | 4 |
4 files changed, 23 insertions, 19 deletions
diff --git a/qml/ChatPage.qml b/qml/ChatPage.qml index fb99eeb..b830bc0 100644 --- a/qml/ChatPage.qml +++ b/qml/ChatPage.qml @@ -54,10 +54,8 @@ Kirigami.ScrollablePage { } function onIncomingMessage(accountId, chatId, msgId) { + updateMessagelist(); console.log("Incoming message for chat " + chatId); - if (chatId == root.chatId) - root.updateMessagelist(); - } function onMessagesChanged(accountId, chatId, msgId) { diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml index 42ceb64..d7e66ae 100644 --- a/qml/ChatlistPage.qml +++ b/qml/ChatlistPage.qml @@ -89,6 +89,7 @@ Kirigami.ScrollablePage { title: qsTr("Chats") Component.onCompleted: { + dcAccounts.startIo(); updateChatlist(); } contextualActions: [ diff --git a/qml/ComposePane.qml b/qml/ComposePane.qml index 254e484..14bfb36 100644 --- a/qml/ComposePane.qml +++ b/qml/ComposePane.qml @@ -82,6 +82,20 @@ Pane { placeholderText: qsTr("Message") wrapMode: TextArea.Wrap selectByMouse: true + Keys.onReturnPressed: { + if (event.key === Qt.Key_Return) { + if (event.modifiers & (Qt.ControlModifier | Qt.ShiftModifier)){ + messageField.append(""); + } else { + if(sendButton.enabled){ + sendButton.clicked(); + dcAccounts.startIo(); + event.accepted = true; + } + } + } + } + Component.onCompleted: { let draft = root.context.getDraft(chatId); if (draft) @@ -118,22 +132,9 @@ Pane { Button { id: sendButton - action: Kirigami.Action { - checked: false - shortcut: "Ctrl+S" - onTriggered:{ - if (sendButton.enabled) { - root.focus = true; - sendButton.focus = true; - sendButton.down = true; - sendButton.clicked(); - sendButton.down = false; - } - } - } hoverEnabled: true ToolTip.visible: hovered - ToolTip.text: "Ctrl+S" + ToolTip.text: "Press Enter" visible: root.canSend Layout.alignment: Qt.AlignBottom icon.name: "document-send" @@ -145,6 +146,7 @@ Pane { attachFileUrl = ""; messageField.text = ""; root.context.setDraft(chatId, null); + messageField.forceActiveFocus(); } } @@ -192,4 +194,7 @@ Pane { } } + Component.onCompleted : { + messageField.forceActiveFocus(); + } } diff --git a/qml/main.qml b/qml/main.qml index 34e94e8..f254274 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -125,7 +125,7 @@ Kirigami.ApplicationWindow { focus: true anchors.centerIn: parent width: 200 - height: 200 + height: 230 padding: 10 contentChildren: [ Text { @@ -135,7 +135,7 @@ Kirigami.ApplicationWindow { font.pixelSize: 14 }, Text { - text: "<b>F1</b>: Displays this" + "<br><b>F2</b>: Work on/offline" + "<br><b>F5</b>: Network check" + "<br><b>Shift+Tab</b>: Account settings" + "<br><b>Alt+C</b>: Clear search" + "<br><b>Alt+Tab</b>: Switch accounts" + "<br><b>Ctrl+F</b>: Search contacts" + "<br><b>Ctrl+N</b>: New chat" + "<br><b>Ctrl+S</b>: Send message" + "<br><b>Ctrl+Tab</b>: Show sidebar" + "<br><b>Ctrl+Q</b>: Quit" + text: "<b>F1</b>: Displays this" + "<br><b>F2</b>: Work on/offline" + "<br><b>F5</b>: Network check" + "<br><b>Shift+Tab</b>: Account settings" + "<br><b>Alt+C</b>: Clear search" + "<br><b>Alt+Tab</b>: Switch accounts" + "<br><b>Ctrl+F</b>: Search contacts" + "<br><b>Ctrl+N</b>: New chat" + "<br><b>Enter</b>: Send message" + "<br><b>Shift/Ctrl+Enter</b>: Add <br>newline" + "<br><b>Ctrl+Tab</b>: Show sidebar" + "<br><b>Ctrl+Q</b>: Quit" topPadding: 20 leftPadding: 10 bottomPadding: 20 |