#include "userinfopopup.hpp" #include "application.hpp" #include "providers/twitch/twitchchannel.hpp" #include "singletons/resourcemanager.hpp" #include "util/layoutcreator.hpp" #include "util/posttothread.hpp" #include "util/urlfetch.hpp" #include "widgets/helper/line.hpp" #include "widgets/helper/rippleeffectlabel.hpp" #include "widgets/label.hpp" #include #include #include #define TEXT_FOLLOWERS "Followers: " #define TEXT_VIEWS "Views: " #define TEXT_CREATED "Created: " namespace chatterino { namespace widgets { UserInfoPopup::UserInfoPopup() : BaseWindow(nullptr, BaseWindow::Flags(BaseWindow::Frameless | BaseWindow::DeleteOnFocusOut | BaseWindow::FramelessDraggable)) , hack_(new bool) { this->setStayInScreenRect(true); #ifdef Q_OS_LINUX this->setWindowFlag(Qt::Popup); #endif auto app = getApp(); auto layout = util::LayoutCreator(this).setLayoutType(); // first line auto head = layout.emplace().withoutMargin(); { // avatar auto avatar = head.emplace(nullptr).assign(&this->ui_.avatarButton); avatar->setScaleIndependantSize(100, 100); QObject::connect(avatar.getElement(), &RippleEffectButton::clicked, [this] { QDesktopServices::openUrl(QUrl("https://twitch.tv/" + this->userName_)); }); // items on the right auto vbox = head.emplace(); { auto name = vbox.emplace