mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed #1362 rightclick on empty split crash
This commit is contained in:
parent
6f710823ed
commit
8153aa7d40
2 changed files with 4 additions and 5 deletions
|
@ -213,9 +213,7 @@ void SplitHeader::initializeLayout()
|
||||||
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] {
|
this->split_->channelChanged.connect([this] {
|
||||||
auto menu = this->createMainMenu();
|
this->dropdownButton_->setMenu(this->createMainMenu());
|
||||||
this->mainMenu_ = menu.get();
|
|
||||||
this->dropdownButton_->setMenu(std::move(menu));
|
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
// add split
|
// add split
|
||||||
|
@ -598,7 +596,9 @@ void SplitHeader::mousePressEvent(QMouseEvent *event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::RightButton: {
|
case Qt::RightButton: {
|
||||||
this->mainMenu_->popup(this->mapToGlobal(event->pos()));
|
auto menu = this->createMainMenu().release();
|
||||||
|
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
menu->popup(this->mapToGlobal(event->pos() + QPoint(0, 4)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ private:
|
||||||
|
|
||||||
// ui
|
// ui
|
||||||
Button *dropdownButton_{};
|
Button *dropdownButton_{};
|
||||||
QMenu *mainMenu_{};
|
|
||||||
Label *titleLabel_{};
|
Label *titleLabel_{};
|
||||||
EffectLabel *modeButton_{};
|
EffectLabel *modeButton_{};
|
||||||
Button *moderationButton_{};
|
Button *moderationButton_{};
|
||||||
|
|
Loading…
Reference in a new issue