2018-06-06 13:35:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
2018-06-26 15:33:51 +02:00
|
|
|
#include "common/Channel.hpp"
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "widgets/BaseWindow.hpp"
|
2018-06-06 13:35:06 +02:00
|
|
|
|
|
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
2018-06-11 21:57:17 +02:00
|
|
|
class Label;
|
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
class UserInfoPopup final : public BaseWindow
|
|
|
|
{
|
2018-06-06 15:54:14 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
public:
|
|
|
|
UserInfoPopup();
|
|
|
|
|
|
|
|
void setData(const QString &name, const ChannelPtr &channel);
|
|
|
|
|
2018-06-07 17:43:21 +02:00
|
|
|
protected:
|
|
|
|
virtual void themeRefreshEvent() override;
|
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
private:
|
|
|
|
bool isMod_;
|
|
|
|
bool isBroadcaster_;
|
|
|
|
|
|
|
|
QString userName_;
|
2018-06-06 15:54:14 +02:00
|
|
|
QString userId_;
|
2018-06-06 13:35:06 +02:00
|
|
|
ChannelPtr channel_;
|
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal userStateChanged;
|
|
|
|
|
2018-06-06 15:54:14 +02:00
|
|
|
void installEvents();
|
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
void updateUserData();
|
|
|
|
void loadAvatar(const QUrl &url);
|
|
|
|
|
2018-06-06 15:54:14 +02:00
|
|
|
std::shared_ptr<bool> hack_;
|
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
struct {
|
|
|
|
RippleEffectButton *avatarButton = nullptr;
|
2018-07-05 22:47:51 +02:00
|
|
|
RippleEffectLabel *viewLogs = nullptr;
|
2018-06-06 13:35:06 +02:00
|
|
|
|
2018-06-11 21:57:17 +02:00
|
|
|
Label *nameLabel = nullptr;
|
|
|
|
Label *viewCountLabel = nullptr;
|
|
|
|
Label *followerCountLabel = nullptr;
|
|
|
|
Label *createdDateLabel = nullptr;
|
2018-06-06 13:35:06 +02:00
|
|
|
|
2018-06-06 15:54:14 +02:00
|
|
|
QCheckBox *follow = nullptr;
|
2018-06-06 13:35:06 +02:00
|
|
|
QCheckBox *ignore = nullptr;
|
|
|
|
QCheckBox *ignoreHighlights = nullptr;
|
|
|
|
} ui_;
|
|
|
|
|
|
|
|
class TimeoutWidget : public BaseWidget
|
|
|
|
{
|
|
|
|
public:
|
2018-06-06 16:17:34 +02:00
|
|
|
enum Action { Ban, Unban, Timeout };
|
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
TimeoutWidget();
|
|
|
|
|
2018-06-06 16:17:34 +02:00
|
|
|
pajlada::Signals::Signal<std::pair<Action, int>> buttonClicked;
|
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|