Expose menu and menu style in PopupMenu.
This commit is contained in:
parent
77856c3a21
commit
e2c940dcdc
2 changed files with 12 additions and 0 deletions
|
|
@ -24,6 +24,10 @@ public:
|
||||||
Menu(QWidget *parent, QMenu *menu, const style::Menu &st = st::defaultMenu);
|
Menu(QWidget *parent, QMenu *menu, const style::Menu &st = st::defaultMenu);
|
||||||
~Menu();
|
~Menu();
|
||||||
|
|
||||||
|
[[nodiscard]] const style::Menu &st() const {
|
||||||
|
return _st;
|
||||||
|
}
|
||||||
|
|
||||||
not_null<QAction*> addAction(base::unique_qptr<ItemBase> widget);
|
not_null<QAction*> addAction(base::unique_qptr<ItemBase> widget);
|
||||||
not_null<QAction*> addAction(
|
not_null<QAction*> addAction(
|
||||||
const QString &text,
|
const QString &text,
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ public:
|
||||||
PopupMenu(QWidget *parent, const style::PopupMenu &st = st::defaultPopupMenu);
|
PopupMenu(QWidget *parent, const style::PopupMenu &st = st::defaultPopupMenu);
|
||||||
PopupMenu(QWidget *parent, QMenu *menu, const style::PopupMenu &st = st::defaultPopupMenu);
|
PopupMenu(QWidget *parent, QMenu *menu, const style::PopupMenu &st = st::defaultPopupMenu);
|
||||||
|
|
||||||
|
[[nodiscard]] const style::PopupMenu &st() const {
|
||||||
|
return _st;
|
||||||
|
}
|
||||||
|
|
||||||
not_null<QAction*> addAction(base::unique_qptr<Menu::ItemBase> widget);
|
not_null<QAction*> addAction(base::unique_qptr<Menu::ItemBase> widget);
|
||||||
not_null<QAction*> addAction(const QString &text, Fn<void()> callback, const style::icon *icon = nullptr, const style::icon *iconOver = nullptr);
|
not_null<QAction*> addAction(const QString &text, Fn<void()> callback, const style::icon *icon = nullptr, const style::icon *iconOver = nullptr);
|
||||||
not_null<QAction*> addAction(const QString &text, std::unique_ptr<PopupMenu> submenu);
|
not_null<QAction*> addAction(const QString &text, std::unique_ptr<PopupMenu> submenu);
|
||||||
|
|
@ -42,6 +46,10 @@ public:
|
||||||
_reactivateParent = false;
|
_reactivateParent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] not_null<Menu::Menu*> menu() const {
|
||||||
|
return _menu.data();
|
||||||
|
}
|
||||||
|
|
||||||
~PopupMenu();
|
~PopupMenu();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue