mirror-chatterino2/src/widgets/userinfopopup.hpp

73 lines
1.4 KiB
C++
Raw Normal View History

2018-06-06 13:35:06 +02:00
#pragma once
#include "channel.hpp"
#include "widgets/basewindow.hpp"
#include <pajlada/signals/signal.hpp>
class QCheckBox;
namespace chatterino {
namespace widgets {
2018-06-11 21:57:17 +02:00
class Label;
2018-06-06 13:35:06 +02:00
class UserInfoPopup final : public BaseWindow
{
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_;
QString userId_;
2018-06-06 13:35:06 +02:00
ChannelPtr channel_;
pajlada::Signals::NoArgSignal userStateChanged;
void installEvents();
2018-06-06 13:35:06 +02:00
void updateUserData();
void loadAvatar(const QUrl &url);
std::shared_ptr<bool> hack_;
2018-06-06 13:35:06 +02:00
struct {
RippleEffectButton *avatarButton = nullptr;
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
QCheckBox *follow = nullptr;
2018-06-06 13:35:06 +02:00
QCheckBox *ignore = nullptr;
QCheckBox *ignoreHighlights = nullptr;
} ui_;
class TimeoutWidget : public BaseWidget
{
public:
enum Action { Ban, Unban, Timeout };
2018-06-06 13:35:06 +02:00
TimeoutWidget();
pajlada::Signals::Signal<std::pair<Action, int>> buttonClicked;
2018-06-06 13:35:06 +02:00
protected:
void paintEvent(QPaintEvent *event) override;
};
};
} // namespace widgets
} // namespace chatterino