From eaf05748ff1fc2b1ced8fdb329661ff20d6b7b85 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Wed, 3 Jan 2018 18:05:49 +0200 Subject: Initial support for read receipts --- include/dialogs/ReadReceipts.h | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 include/dialogs/ReadReceipts.h (limited to 'include/dialogs') 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 +#include +#include +#include +#include +#include + +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 &users); + +protected: + void paintEvent(QPaintEvent *event) override; + +private: + QLabel *topLabel_; + + QListWidget *userList_; +}; +} // dialogs -- cgit 1.4.1