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

71 lines
1.4 KiB
C++
Raw Normal View History

2018-06-06 13:35:06 +02:00
#pragma once
#include <pajlada/signals/signal.hpp>
2020-09-26 14:02:18 +02:00
#include "widgets/BaseWindow.hpp"
2018-06-06 13:35:06 +02:00
class QCheckBox;
namespace chatterino {
class Channel;
using ChannelPtr = std::shared_ptr<Channel>;
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:
2018-07-06 17:11:37 +02:00
virtual void themeChangedEvent() override;
2018-06-07 17:43:21 +02:00
2018-06-06 13:35:06 +02:00
private:
2018-07-06 19:23:47 +02:00
void installEvents();
void updateUserData();
void loadAvatar(const QUrl &url);
2018-06-06 13:35:06 +02:00
bool isMod_;
bool isBroadcaster_;
QString userName_;
QString userId_;
2018-06-06 13:35:06 +02:00
ChannelPtr channel_;
2018-07-06 19:23:47 +02:00
pajlada::Signals::NoArgSignal userStateChanged_;
2018-06-06 13:35:06 +02:00
std::shared_ptr<bool> hack_;
2018-06-06 13:35:06 +02:00
struct {
2018-08-08 15:35:54 +02:00
Button *avatarButton = 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