#include "widgets/helper/splitheader.hpp" #include "application.hpp" #include "providers/twitch/twitchchannel.hpp" #include "providers/twitch/twitchserver.hpp" #include "singletons/resourcemanager.hpp" #include "singletons/thememanager.hpp" #include "util/layoutcreator.hpp" #include "util/urlfetch.hpp" #include "widgets/label.hpp" #include "widgets/split.hpp" #include "widgets/splitcontainer.hpp" #include "widgets/tooltipwidget.hpp" #include #include #include #include #ifdef USEWEBENGINE #include "widgets/streamview.hpp" #endif using namespace chatterino::providers::twitch; namespace chatterino { namespace widgets { SplitHeader::SplitHeader(Split *_split) : BaseWidget(_split) , split(_split) { this->split->focused.connect([this]() { this->themeRefreshEvent(); }); this->split->focusLost.connect([this]() { this->themeRefreshEvent(); }); auto app = getApp(); util::LayoutCreator layoutCreator(this); auto layout = layoutCreator.emplace().withoutMargin(); { // dropdown label auto dropdown = layout.emplace(this).assign(&this->dropdownButton); dropdown->setMouseTracking(true); dropdown->setPixmap(*app->resources->splitHeaderContext->getPixmap()); this->addDropdownItems(dropdown.getElement()); QObject::connect(dropdown.getElement(), &RippleEffectButton::clicked, this, [this] { QTimer::singleShot(80, [&] { this->dropdownMenu.move( this->dropdownButton->mapToGlobal(QPoint(0, this->dropdownButton->height()))); this->dropdownMenu.show(); }); }); // channel name label auto title = layout.emplace