MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / insertActionAfter

Method insertActionAfter

launcher/ui/widgets/WideBar.cpp:113–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void 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
138void WideBar::insertWidgetBefore(QAction* before, QWidget* widget)
139{

Callers 1

ModFolderPageMethod · 0.80

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected