2018-06-06 13:35:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "widgets/BaseWindow.hpp"
|
2019-07-20 18:49:17 +02:00
|
|
|
#include "widgets/helper/ChannelView.hpp"
|
2018-06-06 13:35:06 +02:00
|
|
|
|
|
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
2018-08-11 22:23:06 +02:00
|
|
|
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
|
|
|
|
{
|
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:
|
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();
|
2019-07-20 22:42:01 +02:00
|
|
|
void fillLatestMessages();
|
2018-07-06 19:23:47 +02:00
|
|
|
|
|
|
|
void loadAvatar(const QUrl &url);
|
2018-06-06 13:35:06 +02:00
|
|
|
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_;
|
2019-08-25 14:57:31 +02:00
|
|
|
ChannelView *latestMessages_{};
|
2018-06-06 13:35:06 +02:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
pajlada::Signals::NoArgSignal userStateChanged_;
|
2018-06-06 13:35:06 +02:00
|
|
|
|
2018-06-06 15:54:14 +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
|
|
|
|
2019-07-17 16:50:03 +02:00
|
|
|
// RippleEffectLabel2 *viewLogs = 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
|
|
|
|
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
|