mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
20c974fdab
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
92 lines
2.3 KiB
C++
92 lines
2.3 KiB
C++
#pragma once
|
|
|
|
#include "widgets/DraggablePopup.hpp"
|
|
#include "widgets/helper/ChannelView.hpp"
|
|
|
|
#include <pajlada/signals/scoped-connection.hpp>
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
#include <chrono>
|
|
|
|
class QCheckBox;
|
|
|
|
namespace chatterino {
|
|
|
|
class Channel;
|
|
using ChannelPtr = std::shared_ptr<Channel>;
|
|
class Label;
|
|
|
|
class UserInfoPopup final : public DraggablePopup
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
UserInfoPopup(bool closeAutomatically, QWidget *parent,
|
|
Split *split = nullptr);
|
|
|
|
void setData(const QString &name, const ChannelPtr &channel);
|
|
void setData(const QString &name, const ChannelPtr &contextChannel,
|
|
const ChannelPtr &openingChannel);
|
|
|
|
protected:
|
|
virtual void themeChangedEvent() override;
|
|
virtual void scaleChangedEvent(float scale) override;
|
|
|
|
private:
|
|
void installEvents();
|
|
void updateUserData();
|
|
void updateLatestMessages();
|
|
|
|
void loadAvatar(const QUrl &url);
|
|
bool isMod_;
|
|
bool isBroadcaster_;
|
|
|
|
Split *split_;
|
|
|
|
QString userName_;
|
|
QString userId_;
|
|
QString avatarUrl_;
|
|
// The channel the popup was opened from (e.g. /mentions or #forsen). Can be a special channel.
|
|
ChannelPtr channel_;
|
|
// The channel the messages are rendered from (e.g. #forsen). Can be a special channel, but will try to not be where possible.
|
|
ChannelPtr underlyingChannel_;
|
|
|
|
pajlada::Signals::NoArgSignal userStateChanged_;
|
|
|
|
std::unique_ptr<pajlada::Signals::ScopedConnection> refreshConnection_;
|
|
|
|
struct {
|
|
Button *avatarButton = nullptr;
|
|
Button *localizedNameCopyButton = nullptr;
|
|
|
|
Label *nameLabel = nullptr;
|
|
Label *localizedNameLabel = nullptr;
|
|
Label *followerCountLabel = nullptr;
|
|
Label *createdDateLabel = nullptr;
|
|
Label *userIDLabel = nullptr;
|
|
Label *followageLabel = nullptr;
|
|
Label *subageLabel = nullptr;
|
|
|
|
QCheckBox *block = nullptr;
|
|
QCheckBox *ignoreHighlights = nullptr;
|
|
|
|
Label *noMessagesLabel = nullptr;
|
|
ChannelView *latestMessages = nullptr;
|
|
} 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
|