mirror-chatterino2/src/widgets/dialogs/UserInfoPopup.hpp

72 lines
1.5 KiB
C++
Raw Normal View History

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
{
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;
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
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 chatterino