mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
always update dropdown on split button press
This commit is contained in:
parent
19d9791cba
commit
c50b91d6e9
2 changed files with 4 additions and 1 deletions
|
@ -113,6 +113,9 @@ const QColor &Button::getBorderColor() const
|
||||||
|
|
||||||
void Button::setMenu(std::unique_ptr<QMenu> menu)
|
void Button::setMenu(std::unique_ptr<QMenu> menu)
|
||||||
{
|
{
|
||||||
|
if (this->menu_)
|
||||||
|
this->menu_.release()->deleteLater();
|
||||||
|
|
||||||
this->menu_ = std::move(menu);
|
this->menu_ = std::move(menu);
|
||||||
|
|
||||||
this->menu_->installEventFilter(
|
this->menu_->installEventFilter(
|
||||||
|
|
|
@ -284,7 +284,7 @@ void SplitHeader::initializeLayout()
|
||||||
// dropdown
|
// dropdown
|
||||||
this->dropdownButton_ = makeWidget<Button>([&](auto w) {
|
this->dropdownButton_ = makeWidget<Button>([&](auto w) {
|
||||||
/// XXX: this never gets disconnected
|
/// XXX: this never gets disconnected
|
||||||
this->split_->channelChanged.connect([this] {
|
QObject::connect(w, &Button::leftMousePress, this, [this] {
|
||||||
this->dropdownButton_->setMenu(this->createMainMenu());
|
this->dropdownButton_->setMenu(this->createMainMenu());
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in a new issue