mirror of https://github.com/procxx/kepka.git
Fix crash in theme editor closing.
This commit is contained in:
parent
6c2a29b83f
commit
05df4f832b
|
@ -702,20 +702,20 @@ void Editor::showMenu() {
|
||||||
if (_menu) {
|
if (_menu) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_menu.create(this);
|
_menu = base::make_unique_q<Ui::DropdownMenu>(this);
|
||||||
_menu->setHiddenCallback([weak = Ui::MakeWeak(this), menu = _menu.data()]{
|
_menu->setHiddenCallback([weak = Ui::MakeWeak(this), menu = _menu.get()]{
|
||||||
menu->deleteLater();
|
menu->deleteLater();
|
||||||
if (weak && weak->_menu == menu) {
|
if (weak && weak->_menu == menu) {
|
||||||
weak->_menu = nullptr;
|
weak->_menu = nullptr;
|
||||||
weak->_menuToggle->setForceRippled(false);
|
weak->_menuToggle->setForceRippled(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_menu->setShowStartCallback(crl::guard(this, [this, menu = _menu.data()]{
|
_menu->setShowStartCallback(crl::guard(this, [this, menu = _menu.get()]{
|
||||||
if (_menu == menu) {
|
if (_menu == menu) {
|
||||||
_menuToggle->setForceRippled(true);
|
_menuToggle->setForceRippled(true);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
_menu->setHideStartCallback(crl::guard(this, [this, menu = _menu.data()]{
|
_menu->setHideStartCallback(crl::guard(this, [this, menu = _menu.get()]{
|
||||||
if (_menu == menu) {
|
if (_menu == menu) {
|
||||||
_menuToggle->setForceRippled(false);
|
_menuToggle->setForceRippled(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ private:
|
||||||
QPointer<Inner> _inner;
|
QPointer<Inner> _inner;
|
||||||
object_ptr<Ui::CrossButton> _close;
|
object_ptr<Ui::CrossButton> _close;
|
||||||
object_ptr<Ui::IconButton> _menuToggle;
|
object_ptr<Ui::IconButton> _menuToggle;
|
||||||
object_ptr<Ui::DropdownMenu> _menu = { nullptr };
|
base::unique_qptr<Ui::DropdownMenu> _menu;
|
||||||
object_ptr<Ui::MultiSelect> _select;
|
object_ptr<Ui::MultiSelect> _select;
|
||||||
object_ptr<Ui::PlainShadow> _leftShadow;
|
object_ptr<Ui::PlainShadow> _leftShadow;
|
||||||
object_ptr<Ui::PlainShadow> _topShadow;
|
object_ptr<Ui::PlainShadow> _topShadow;
|
||||||
|
|
Loading…
Reference in New Issue