mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
776ce8bdbc
* Added subage and followage information to usercard We are using Leppunen's API here to determine user's subage to the current channel and since that API call also returns followage information I decided to utilize that and save ourselves an extra Helix API call. I also added new files specifying new class and methods for Ivr API, which can be very easily expanded with new methods in the future if we ever have to do that. When I was coding I also saw couple unnecessary nitpicks which I fixed :) * Added changelog entry * remove empty lambda * Update UserInfoPopup.cpp * xd Co-authored-by: fourtf <tf.four@gmail.com>
84 lines
1.9 KiB
C++
84 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include "widgets/BaseWindow.hpp"
|
|
#include "widgets/helper/ChannelView.hpp"
|
|
|
|
#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:
|
|
UserInfoPopup(bool closeAutomatically);
|
|
~UserInfoPopup();
|
|
|
|
void setData(const QString &name, const ChannelPtr &channel);
|
|
|
|
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_;
|
|
|
|
QString userName_;
|
|
QString userId_;
|
|
ChannelPtr channel_;
|
|
|
|
pajlada::Signals::NoArgSignal userStateChanged_;
|
|
|
|
// replace with ScopedConnection once https://github.com/pajlada/signals/pull/10 gets merged
|
|
pajlada::Signals::Connection refreshConnection_;
|
|
|
|
std::shared_ptr<bool> hack_;
|
|
|
|
struct {
|
|
Button *avatarButton = nullptr;
|
|
|
|
Label *nameLabel = nullptr;
|
|
Label *viewCountLabel = nullptr;
|
|
Label *followerCountLabel = nullptr;
|
|
Label *createdDateLabel = nullptr;
|
|
Label *userIDLabel = nullptr;
|
|
Label *followageSubageLabel = nullptr;
|
|
|
|
QCheckBox *follow = nullptr;
|
|
QCheckBox *ignore = nullptr;
|
|
QCheckBox *ignoreHighlights = nullptr;
|
|
|
|
Label *noMessagesLabel = nullptr;
|
|
ChannelView *latestMessages = nullptr;
|
|
QPushButton *refreshButton = 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
|