#include "widgets/helper/splitheader.hpp" #include "singletons/resourcemanager.hpp" #include "singletons/thememanager.hpp" #include "twitch/twitchchannel.hpp" #include "util/layoutcreator.hpp" #include "util/urlfetch.hpp" #include "widgets/helper/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 namespace chatterino { namespace widgets { SplitHeader::SplitHeader(Split *_split) : BaseWidget(_split) , split(_split) { this->setMouseTracking(true); singletons::ResourceManager &resourceManager = singletons::ResourceManager::getInstance(); util::LayoutCreator layoutCreator(this); auto layout = layoutCreator.emplace().withoutMargin(); { // dropdown label auto dropdown = layout.emplace(this).assign(&this->dropdownButton); dropdown->setMouseTracking(true); dropdown->setPixmap(resourceManager.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(); }); }); layout->addStretch(1); // channel name label // auto title = layout.emplace