Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85833118
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6ea9fe9..288fcf4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,9 @@
# Change log
## Unreleased
- Use fluent for translations. https://lily.kazv.moe/kazv/kazv/-/tree/tusooa/3-fluent
- Support read and save client state. https://lily.kazv.moe/kazv/kazv/-/merge_requests/2
- Support common event types. https://lily.kazv.moe/kazv/kazv/-/merge_requests/3
+- Add send message shortcut. https://lily.kazv.moe/kazv/kazv/-/merge_requests/7
diff --git a/src/contents/ui/SendMessageBox.qml b/src/contents/ui/SendMessageBox.qml
index b71135c..41aa52c 100644
--- a/src/contents/ui/SendMessageBox.qml
+++ b/src/contents/ui/SendMessageBox.qml
@@ -1,56 +1,65 @@
/*
* Copyright (C) 2020-2021 Tusooa Zhu <tusooa@kazv.moe>
*
* This file is part of kazv.
*
* kazv is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* kazv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with kazv. If not, see <https://www.gnu.org/licenses/>.
*/
-import QtQuick 2.2
+import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import org.kde.kirigami 2.13 as Kirigami
import '.' as Kazv
RowLayout {
property var room
onRoomChanged: {
textArea.text = room.localDraft
}
TextArea {
id: textArea
+ property var shortcutList: ["Ctrl+Return", "Ctrl+Enter"]
placeholderText: l10n.get('send-message-box-input-placeholder')
Layout.fillWidth: true
wrapMode: TextEdit.Wrap
onTextChanged: {
room.localDraft = text
}
+ // Shortcut keys for sending messages (TODO: Shortcut keys customized by the user)
+ Shortcut {
+ sequences: textArea.shortcutList
+ onActivated: {
+ sendAction.trigger()
+ }
+ }
}
Kirigami.Action {
id: sendAction
iconName: "document-send"
onTriggered: {
room.sendTextMessage(textArea.text)
textArea.text = ""
}
}
ToolButton {
icon.name: "document-send"
onClicked: sendAction.trigger()
}
+
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 2, 10:02 AM (3 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1804366
Default Alt Text
(2 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline