2018-05-01 19:35:28 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QFrame>
|
|
|
|
#include <QListWidget>
|
|
|
|
|
|
|
|
class Avatar;
|
|
|
|
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:
|
2018-05-08 20:30:09 +03:00
|
|
|
MemberList(const QString &room_id, QWidget *parent = nullptr);
|
2018-05-01 19:35:28 +03:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void addUsers(const std::vector<RoomMember> &users);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
2018-05-04 17:59:29 +03:00
|
|
|
void hideEvent(QHideEvent *event) override
|
|
|
|
{
|
|
|
|
list_->clear();
|
|
|
|
QFrame::hideEvent(event);
|
|
|
|
}
|
2018-05-01 19:35:28 +03:00
|
|
|
|
|
|
|
private:
|
2018-05-04 17:59:29 +03:00
|
|
|
void moveButtonToBottom();
|
|
|
|
|
2018-05-01 19:35:28 +03:00
|
|
|
QString room_id_;
|
|
|
|
QLabel *topLabel_;
|
|
|
|
QListWidget *list_;
|
|
|
|
FlatButton *moreBtn_;
|
|
|
|
};
|
|
|
|
} // dialogs
|