summary refs log tree commit diff
path: root/src/dialogs/MemberList.h
blob: c01b6829fd05df18e9ca02fdc2c5890710304126 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once

#include <QFrame>
#include <QListWidget>

class Avatar;
class QPushButton;
class QHBoxLayout;
class QLabel;
class QVBoxLayout;

struct RoomMember;

template<class T>
class QSharedPointer;

namespace dialogs {

class MemberItem : public QWidget
{
        Q_OBJECT

public:
        MemberItem(const RoomMember &member, QWidget *parent);

protected:
        void paintEvent(QPaintEvent *) override;

private:
        QHBoxLayout *topLayout_;
        QVBoxLayout *textLayout_;

        Avatar *avatar_;

        QLabel *userName_;
        QLabel *userId_;
};

class MemberList : public QFrame
{
        Q_OBJECT
public:
        MemberList(const QString &room_id, QWidget *parent = nullptr);

public slots:
        void addUsers(const std::vector<RoomMember> &users);

private:
        QString room_id_;
        QLabel *topLabel_;
        QListWidget *list_;
};
} // dialogs