2019-09-08 22:27:57 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "widgets/BaseWindow.hpp"
|
2020-06-21 14:15:14 +02:00
|
|
|
#include "widgets/helper/ChannelView.hpp"
|
2019-09-08 22:27:57 +02:00
|
|
|
|
|
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class Channel;
|
|
|
|
using ChannelPtr = std::shared_ptr<Channel>;
|
|
|
|
class Label;
|
|
|
|
|
|
|
|
class UserInfoPopup final : public BaseWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
UserInfoPopup();
|
|
|
|
|
|
|
|
void setData(const QString &name, const ChannelPtr &channel);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void themeChangedEvent() override;
|
|
|
|
virtual void scaleChangedEvent(float scale) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void installEvents();
|
|
|
|
void updateUserData();
|
2020-06-21 14:15:14 +02:00
|
|
|
void updateLatestMessages();
|
2019-09-08 22:27:57 +02:00
|
|
|
|
|
|
|
void loadAvatar(const QUrl &url);
|
|
|
|
bool isMod_;
|
|
|
|
bool isBroadcaster_;
|
|
|
|
|
|
|
|
QString userName_;
|
|
|
|
QString userId_;
|
|
|
|
ChannelPtr channel_;
|
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal userStateChanged_;
|
|
|
|
|
|
|
|
std::shared_ptr<bool> hack_;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
Button *avatarButton = nullptr;
|
|
|
|
|
|
|
|
Label *nameLabel = nullptr;
|
|
|
|
Label *viewCountLabel = nullptr;
|
|
|
|
Label *followerCountLabel = nullptr;
|
|
|
|
Label *createdDateLabel = nullptr;
|
|
|
|
Label *userIDLabel = nullptr;
|
|
|
|
|
|
|
|
QCheckBox *follow = nullptr;
|
|
|
|
QCheckBox *ignore = nullptr;
|
|
|
|
QCheckBox *ignoreHighlights = nullptr;
|
2020-06-21 14:15:14 +02:00
|
|
|
|
|
|
|
Label *noMessagesLabel = nullptr;
|
|
|
|
ChannelView *latestMessages = nullptr;
|
|
|
|
QPushButton *refreshButton = nullptr;
|
2019-09-08 22:27:57 +02:00
|
|
|
} ui_;
|
|
|
|
|
|
|
|
class TimeoutWidget : public BaseWidget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum Action { Ban, Unban, Timeout };
|
|
|
|
|
|
|
|
TimeoutWidget();
|
|
|
|
|
|
|
|
pajlada::Signals::Signal<std::pair<Action, int>> buttonClicked;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|