matrixion/include/dialogs/ReadReceipts.h

54 lines
1,012 B
C
Raw Permalink Normal View History

2018-01-03 19:05:49 +03:00
#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:
2018-04-21 16:34:50 +03:00
ReceiptItem(QWidget *parent,
const QString &user_id,
uint64_t timestamp,
const QString &room_id);
2018-01-03 19:05:49 +03:00
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, std::greater<uint64_t>> &users);
2018-01-03 19:05:49 +03:00
protected:
void paintEvent(QPaintEvent *event) override;
private:
QLabel *topLabel_;
QListWidget *userList_;
};
} // dialogs