aboutsummaryrefslogtreecommitdiff
path: root/qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml')
-rw-r--r--qml/ComposePane.qml15
-rw-r--r--qml/Message.qml5
2 files changed, 19 insertions, 1 deletions
diff --git a/qml/ComposePane.qml b/qml/ComposePane.qml
index 54480d5..44cbd7c 100644
--- a/qml/ComposePane.qml
+++ b/qml/ComposePane.qml
@@ -20,6 +20,21 @@ Pane {
placeholderText: qsTr("Message")
wrapMode: TextArea.Wrap
selectByMouse: true
+
+ Component.onCompleted: {
+ let draft = context.getDraft(chatId)
+ if (draft) {
+ messageField.text = draft.text
+ }
+ }
+
+ Connections {
+ function onEditingFinished() {
+ var msg = context.newMessage(10)
+ msg.setText(messageField.text)
+ context.setDraft(chatId, msg)
+ }
+ }
}
Button {
diff --git a/qml/Message.qml b/qml/Message.qml
index fdd895a..68b2979 100644
--- a/qml/Message.qml
+++ b/qml/Message.qml
@@ -161,13 +161,16 @@ RowLayout {
// Message
TextEdit {
Layout.maximumWidth: messageObject.width > 30 ? messageObject.width - 30 : messageObject.width
- text: messageObject.message.text
textFormat: Text.PlainText
selectByMouse: true
readOnly: true
color: "black"
wrapMode: Text.Wrap
font.pixelSize: 14
+
+ Component.onCompleted: {
+ text = messageObject.message.text
+ }
}
Row {
HtmlViewSheet {