| 111 | } |
| 112 | |
| 113 | void WideBar::insertActionAfter(QAction* after, QAction* action) |
| 114 | { |
| 115 | auto iter = getMatching(after); |
| 116 | if (iter == m_entries.end()) |
| 117 | return; |
| 118 | |
| 119 | iter++; |
| 120 | // the action to insert after is present |
| 121 | // however, the element after it isn't valid |
| 122 | if (iter == m_entries.end()) { |
| 123 | // append the action instead of inserting it |
| 124 | addAction(action); |
| 125 | return; |
| 126 | } |
| 127 | |
| 128 | BarEntry entry; |
| 129 | entry.bar_action = insertWidget(iter->bar_action, new ActionButton(action, this, m_use_default_action)); |
| 130 | entry.menu_action = action; |
| 131 | entry.type = BarEntry::Type::Action; |
| 132 | |
| 133 | m_entries.insert(iter, entry); |
| 134 | |
| 135 | m_menu_state = MenuState::Dirty; |
| 136 | } |
| 137 | |
| 138 | void WideBar::insertWidgetBefore(QAction* before, QWidget* widget) |
| 139 | { |