aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-08-28 12:03:50 +0000
committerlink2xt <link2xt@testrun.org>2021-08-28 15:05:39 +0300
commite3b1f014df55f08f557667919d271f079f5f492f (patch)
treeddec47a41a69cb3f994756fa52d789571e40a702
parent6d2fc32a423b7b470521c67d94d9b59c168a948f (diff)
downloadkdeltachat-e3b1f014df55f08f557667919d271f079f5f492f.tar.gz
kdeltachat-e3b1f014df55f08f557667919d271f079f5f492f.zip
Add padlock and bot icons to messages, improve layout
-rw-r--r--message.cpp6
-rw-r--r--message.h3
-rw-r--r--qml/Message.qml21
3 files changed, 28 insertions, 2 deletions
diff --git a/message.cpp b/message.cpp
index 4aae043..fdaae93 100644
--- a/message.cpp
+++ b/message.cpp
@@ -122,6 +122,12 @@ DcMessage::getShowPadlock()
return dc_msg_get_showpadlock(m_message);
}
+bool
+DcMessage::getIsBot()
+{
+ return dc_msg_is_bot(m_message);
+}
+
QString
DcMessage::getOverrideSenderName()
{
diff --git a/message.h b/message.h
index d70703d..8930f02 100644
--- a/message.h
+++ b/message.h
@@ -21,6 +21,8 @@ class DcMessage : public QObject {
Q_PROPERTY(QString filename READ getFilename CONSTANT)
Q_PROPERTY(int width READ getWidth CONSTANT)
Q_PROPERTY(int height READ getHeight CONSTANT)
+ Q_PROPERTY(bool showPadlock READ getShowPadlock CONSTANT)
+ Q_PROPERTY(bool isBot READ getIsBot CONSTANT)
Q_PROPERTY(bool isInfo READ isInfo CONSTANT)
Q_PROPERTY(QString quotedText READ getQuotedText CONSTANT)
Q_PROPERTY(DcMessage *quotedMessage READ getQuotedMessage CONSTANT)
@@ -53,6 +55,7 @@ public:
int getHeight();
//int getDuration();
bool getShowPadlock();
+ bool getIsBot();
//uint32_t getEphemeralTimer();
//int64_t getEphemeralTimestamp();
//... getsummary ...
diff --git a/qml/Message.qml b/qml/Message.qml
index c7daf07..15d4b09 100644
--- a/qml/Message.qml
+++ b/qml/Message.qml
@@ -200,7 +200,9 @@ RowLayout {
text = messageObject.message.text
}
}
- Row {
+ RowLayout {
+ Layout.alignment: Qt.AlignRight
+
HtmlViewSheet {
id: htmlSheet
subject: ""
@@ -216,8 +218,23 @@ RowLayout {
htmlSheet.open()
}
}
+
+ Kirigami.Icon {
+ source: "computer"
+ visible: messageObject.message.isBot
+ Layout.preferredHeight: Kirigami.Units.gridUnit
+ Layout.preferredWidth: Kirigami.Units.gridUnit
+ }
+
+ Kirigami.Icon {
+ source: messageObject.message.showPadlock ? "lock" : "unlock"
+ Layout.preferredHeight: Kirigami.Units.gridUnit
+ Layout.preferredWidth: Kirigami.Units.gridUnit
+ }
+
Label {
- Layout.fillWidth: true
+ font.pixelSize: 14
+ color: Kirigami.Theme.disabledTextColor
text: Qt.formatDateTime(messageObject.message.timestamp, "dd. MMM yyyy, hh:mm")
+ (messageObject.message.state == 26 ? "✓"
: messageObject.message.state == 28 ? "✓✓"