summary refs log tree commit diff
path: root/include/dialogs
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-01 19:35:28 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-01 19:35:28 +0300
commit763330fd3c259b7a877eb05944783e92c0afcb80 (patch)
treecf6810cba9aded346ecf8c3dbede7ed0e7d8d68f /include/dialogs
parentAdd prototype room settings menu (diff)
downloadnheko-763330fd3c259b7a877eb05944783e92c0afcb80.tar.xz
Add member list
Diffstat (limited to 'include/dialogs')
-rw-r--r--include/dialogs/MemberList.hpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/dialogs/MemberList.hpp b/include/dialogs/MemberList.hpp
new file mode 100644

index 00000000..09a56aab --- /dev/null +++ b/include/dialogs/MemberList.hpp
@@ -0,0 +1,57 @@ +#pragma once + +#include <QFrame> +#include <QListWidget> + +class Avatar; +class Cache; +class FlatButton; +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); + +private: + QHBoxLayout *topLayout_; + QVBoxLayout *textLayout_; + + Avatar *avatar_; + + QLabel *userName_; + QLabel *userId_; +}; + +class MemberList : public QFrame +{ + Q_OBJECT +public: + MemberList(const QString &room_id, QSharedPointer<Cache> cache, QWidget *parent = nullptr); + +public slots: + void addUsers(const std::vector<RoomMember> &users); + +protected: + void paintEvent(QPaintEvent *event) override; + void moveButtonToBottom(); + +private: + QString room_id_; + QLabel *topLabel_; + QListWidget *list_; + QSharedPointer<Cache> cache_; + FlatButton *moreBtn_; +}; +} // dialogs