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:
|
2020-10-31 16:42:48 +01:00
|
|
|
UserInfoPopup(bool closeAutomatically, QWidget *parent);
|
2020-09-26 16:59:40 +02:00
|
|
|
~UserInfoPopup();
|
2019-09-08 22:27:57 +02:00
|
|
|
|
|
|
|
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_;
|
2021-03-14 15:09:16 +01:00
|
|
|
QString avatarUrl_;
|
2019-09-08 22:27:57 +02:00
|
|
|
ChannelPtr channel_;
|
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal userStateChanged_;
|
|
|
|
|
2020-09-26 16:59:40 +02:00
|
|
|
// replace with ScopedConnection once https://github.com/pajlada/signals/pull/10 gets merged
|
|
|
|
pajlada::Signals::Connection refreshConnection_;
|
|
|
|
|
2019-09-08 22:27:57 +02:00
|
|
|
std::shared_ptr<bool> hack_;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
Button *avatarButton = nullptr;
|
2021-11-06 13:44:27 +01:00
|
|
|
Button *localizedNameCopyButton = nullptr;
|
2019-09-08 22:27:57 +02:00
|
|
|
|
|
|
|
Label *nameLabel = nullptr;
|
2021-11-06 13:44:27 +01:00
|
|
|
Label *localizedNameLabel = nullptr;
|
2019-09-08 22:27:57 +02:00
|
|
|
Label *viewCountLabel = nullptr;
|
|
|
|
Label *followerCountLabel = nullptr;
|
|
|
|
Label *createdDateLabel = nullptr;
|
|
|
|
Label *userIDLabel = nullptr;
|
2020-10-21 17:02:24 +02:00
|
|
|
Label *followageLabel = nullptr;
|
|
|
|
Label *subageLabel = nullptr;
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2021-02-14 14:01:13 +01:00
|
|
|
QCheckBox *block = nullptr;
|
2019-09-08 22:27:57 +02:00
|
|
|
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
|