feat: add Widebar::InsertWidgetBefore method
Signed-off-by: leo78913 <leo3758@riseup.net>
This commit is contained in:
parent
b9df10c8bd
commit
3da1d6a464
@ -111,6 +111,16 @@ void WideBar::insertActionAfter(QAction* after, QAction* action)
|
||||
m_menu_state = MenuState::Dirty;
|
||||
}
|
||||
|
||||
void WideBar::insertWidgetBefore(QAction* before, QWidget* widget)
|
||||
{
|
||||
auto iter = getMatching(before);
|
||||
if (iter == m_entries.end())
|
||||
return;
|
||||
|
||||
BarEntry entry;
|
||||
entry.bar_action = insertWidget(iter->bar_action, widget);
|
||||
}
|
||||
|
||||
void WideBar::insertSpacer(QAction* action)
|
||||
{
|
||||
auto iter = getMatching(action);
|
||||
|
@ -22,6 +22,7 @@ class WideBar : public QToolBar {
|
||||
void insertSeparator(QAction* before);
|
||||
void insertActionBefore(QAction* before, QAction* action);
|
||||
void insertActionAfter(QAction* after, QAction* action);
|
||||
void insertWidgetBefore(QAction* before, QWidget* widget);
|
||||
|
||||
QMenu* createContextMenu(QWidget* parent = nullptr, const QString& title = QString());
|
||||
void showVisibilityMenu(const QPoint&);
|
||||
|
Loading…
Reference in New Issue
Block a user