summary refs log tree commit diff
path: root/include/dialogs
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-03 18:05:49 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-03 18:06:29 +0200
commiteaf05748ff1fc2b1ced8fdb329661ff20d6b7b85 (patch)
tree4d2f190f9662581f7ff8a1e95b146ba225e0a8a6 /include/dialogs
parentAdd Alpine Linux installation instructions (#191) (diff)
downloadnheko-eaf05748ff1fc2b1ced8fdb329661ff20d6b7b85.tar.xz
Initial support for read receipts
Diffstat (limited to 'include/dialogs')
-rw-r--r--include/dialogs/ReadReceipts.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/dialogs/ReadReceipts.h b/include/dialogs/ReadReceipts.h
new file mode 100644
index 00000000..42a9e1b7
--- /dev/null
+++ b/include/dialogs/ReadReceipts.h
@@ -0,0 +1,50 @@
+#pragma once
+
+#include <QDateTime>
+#include <QFrame>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QListWidget>
+#include <QVBoxLayout>
+
+class Avatar;
+
+namespace dialogs {
+
+class ReceiptItem : public QWidget
+{
+        Q_OBJECT
+
+public:
+        ReceiptItem(QWidget *parent, const QString &user_id, uint64_t timestamp);
+
+private:
+        QString dateFormat(const QDateTime &then) const;
+
+        QHBoxLayout *topLayout_;
+        QVBoxLayout *textLayout_;
+
+        Avatar *avatar_;
+
+        QLabel *userName_;
+        QLabel *timestamp_;
+};
+
+class ReadReceipts : public QFrame
+{
+        Q_OBJECT
+public:
+        explicit ReadReceipts(QWidget *parent = nullptr);
+
+public slots:
+        void addUsers(const std::multimap<uint64_t, std::string> &users);
+
+protected:
+        void paintEvent(QPaintEvent *event) override;
+
+private:
+        QLabel *topLabel_;
+
+        QListWidget *userList_;
+};
+} // dialogs