aboutsummaryrefslogtreecommitdiff
path: root/qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml')
-rw-r--r--qml/HtmlViewSheet.qml23
-rw-r--r--qml/Message.qml29
2 files changed, 46 insertions, 6 deletions
diff --git a/qml/HtmlViewSheet.qml b/qml/HtmlViewSheet.qml
new file mode 100644
index 0000000..03e0147
--- /dev/null
+++ b/qml/HtmlViewSheet.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.12
+import QtWebEngine 1.10
+
+import org.kde.kirigami 2.12 as Kirigami
+
+Kirigami.OverlaySheet {
+ property string subject
+ property string html
+
+ header: Kirigami.Heading {
+ text: subject
+ }
+
+ WebEngineView {
+ id: web
+ height: 500
+ }
+
+ onHtmlChanged: {
+ console.log("Loading HTML!")
+ web.loadHtml(html)
+ }
+}
diff --git a/qml/Message.qml b/qml/Message.qml
index 492c5cb..fdd895a 100644
--- a/qml/Message.qml
+++ b/qml/Message.qml
@@ -169,12 +169,29 @@ RowLayout {
wrapMode: Text.Wrap
font.pixelSize: 14
}
- Label {
- Layout.fillWidth: true
- text: messageObject.message.state == 26 ? "✓"
- : messageObject.message.state == 28 ? "✓✓"
- : messageObject.message.state == 24 ? "✗"
- : "";
+ Row {
+ HtmlViewSheet {
+ id: htmlSheet
+ subject: ""
+ html: ""
+ }
+
+ Button {
+ text: "Show full message"
+ visible: messageObject.message.hasHtml
+ onPressed: {
+ htmlSheet.subject = messageObject.message.subject
+ htmlSheet.html = messageObject.context.getMessageHtml(messageObject.message.id)
+ htmlSheet.open()
+ }
+ }
+ Label {
+ Layout.fillWidth: true
+ text: messageObject.message.state == 26 ? "✓"
+ : messageObject.message.state == 28 ? "✓✓"
+ : messageObject.message.state == 24 ? "✗"
+ : "";
+ }
}
}
}