mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
always update dropdown on split button press (#2590)
This commit is contained in:
parent
80d52a37f6
commit
2db7a30ae5
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)
|
||||
{
|
||||
if (this->menu_)
|
||||
this->menu_.release()->deleteLater();
|
||||
|
||||
this->menu_ = std::move(menu);
|
||||
|
||||
this->menu_->installEventFilter(
|
||||
|
|
|
@ -284,7 +284,7 @@ void SplitHeader::initializeLayout()
|
|||
// dropdown
|
||||
this->dropdownButton_ = makeWidget<Button>([&](auto w) {
|
||||
/// XXX: this never gets disconnected
|
||||
this->split_->channelChanged.connect([this] {
|
||||
QObject::connect(w, &Button::leftMousePress, this, [this] {
|
||||
this->dropdownButton_->setMenu(this->createMainMenu());
|
||||
});
|
||||
}),
|
||||
|
|
Loading…
Reference in a new issue