2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-07-31 22:14:54 +02:00
|
|
|
#include "concurrentmap.hpp"
|
2017-04-12 17:46:44 +02:00
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace Ui {
|
2017-04-19 15:24:19 +02:00
|
|
|
class AccountPopup;
|
2017-04-12 17:46:44 +02:00
|
|
|
}
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-04-12 17:46:44 +02:00
|
|
|
|
|
|
|
class Channel;
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace widgets {
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2017-04-19 15:24:19 +02:00
|
|
|
class AccountPopupWidget : public QWidget
|
2017-04-12 17:46:44 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-05-27 17:45:40 +02:00
|
|
|
AccountPopupWidget(std::shared_ptr<Channel> &channel);
|
2017-04-12 17:46:44 +02:00
|
|
|
|
|
|
|
void setName(const QString &name);
|
|
|
|
|
|
|
|
private:
|
2017-04-19 15:24:19 +02:00
|
|
|
Ui::AccountPopup *_ui;
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2017-07-31 22:14:54 +02:00
|
|
|
void getUserId();
|
|
|
|
void getUserData();
|
|
|
|
void loadAvatar(const QUrl &avatarUrl);
|
|
|
|
|
2017-05-27 17:45:40 +02:00
|
|
|
std::shared_ptr<Channel> &_channel;
|
2017-07-31 22:14:54 +02:00
|
|
|
|
|
|
|
QString userID;
|
|
|
|
QPixmap avatar;
|
|
|
|
|
|
|
|
ConcurrentMap<QString,QPixmap> avatarMap;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void focusOutEvent(QFocusEvent *event) override;
|
2017-04-12 17:46:44 +02:00
|
|
|
};
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|