Add viewer list button to twitch channel header (#2042)

This commit is contained in:
Dave
2020-10-10 11:24:53 -04:00
committed by GitHub
parent e4d7f49952
commit 98762fdfa0
9 changed files with 31 additions and 0 deletions
+13
View File
@@ -228,6 +228,11 @@ void SplitHeader::initializeLayout()
}
});
}),
// viewer list
this->viewersButton_ = makeWidget<Button>([&](auto w) {
QObject::connect(w, &Button::leftClicked, this,
[this]() { this->split_->showViewerList(); });
}),
// dropdown
this->dropdownButton_ = makeWidget<Button>([&](auto w) {
/// XXX: this never gets disconnected
@@ -567,6 +572,7 @@ void SplitHeader::scaleChangedEvent(float scale)
this->setFixedHeight(w);
this->dropdownButton_->setFixedWidth(w);
this->moderationButton_->setFixedWidth(w);
this->viewersButton_->setFixedWidth(w);
this->addButton_->setFixedWidth(w * 5 / 8);
}
@@ -575,6 +581,11 @@ void SplitHeader::setAddButtonVisible(bool value)
this->addButton_->setVisible(value);
}
void SplitHeader::setViewersButtonVisible(bool value)
{
this->viewersButton_->setVisible(value);
}
void SplitHeader::updateChannelText()
{
auto indirectChannel = this->split_->getIndirectChannel();
@@ -780,11 +791,13 @@ void SplitHeader::themeChangedEvent()
// --
if (this->theme->isLightTheme())
{
this->viewersButton_->setPixmap(getResources().buttons.viewersDark);
this->dropdownButton_->setPixmap(getResources().buttons.menuDark);
this->addButton_->setPixmap(getResources().buttons.addSplit);
}
else
{
this->viewersButton_->setPixmap(getResources().buttons.viewersLight);
this->dropdownButton_->setPixmap(getResources().buttons.menuLight);
this->addButton_->setPixmap(getResources().buttons.addSplitDark);
}