Page MenuHomePhorge

SendMessageBox.qml
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

SendMessageBox.qml

/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2020-2021 Tusooa Zhu <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
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

Mime Type
text/plain
Expires
Fri, Jul 18, 6:50 AM (52 m, 20 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
245842
Default Alt Text
SendMessageBox.qml (1 KB)

Event Timeline