diff --git a/ui/widgets/menu/menu_add_action_callback_factory.cpp b/ui/widgets/menu/menu_add_action_callback_factory.cpp index 443fa45..2d1c73e 100644 --- a/ui/widgets/menu/menu_add_action_callback_factory.cpp +++ b/ui/widgets/menu/menu_add_action_callback_factory.cpp @@ -24,7 +24,7 @@ MenuCallback CreateAddActionCallback( a.icon); // Dummy menu. action->setMenu(Ui::CreateChild(menu->menu().get())); - a.fillSubmenu(menu->ensureSubmenu(action)); + a.fillSubmenu(menu->ensureSubmenu(action, menu->st())); return action; } else if (a.isSeparator) { return menu->addSeparator(); diff --git a/ui/widgets/popup_menu.cpp b/ui/widgets/popup_menu.cpp index c783372..75cd2c0 100644 --- a/ui/widgets/popup_menu.cpp +++ b/ui/widgets/popup_menu.cpp @@ -259,7 +259,9 @@ void PopupMenu::init() { setAttribute(Qt::WA_TranslucentBackground, true); } -not_null PopupMenu::ensureSubmenu(not_null action) { +not_null PopupMenu::ensureSubmenu( + not_null action, + const style::PopupMenu &st) { const auto &list = actions(); const auto i = ranges::find(list, action); Assert(i != end(list)); @@ -270,7 +272,7 @@ not_null PopupMenu::ensureSubmenu(not_null action) { } const auto result = _submenus.emplace( action, - base::make_unique_q(parentWidget(), st()) + base::make_unique_q(parentWidget(), st) ).first->second.get(); result->deleteOnHide(false); return result; diff --git a/ui/widgets/popup_menu.h b/ui/widgets/popup_menu.h index 1cfe9e7..2be0d27 100644 --- a/ui/widgets/popup_menu.h +++ b/ui/widgets/popup_menu.h @@ -49,7 +49,8 @@ public: [[nodiscard]] const std::vector> &actions() const; [[nodiscard]] not_null ensureSubmenu( - not_null action); + not_null action, + const style::PopupMenu &st); void removeSubmenu(not_null action); void checkSubmenuShow(); bool empty() const;