Add viewer list button to twitch channel header (#2042)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user