menu: Emit exec actions

Now the menu closes properly again if any actions on it are clicked
This commit is contained in:
patrick96 2020-05-30 19:28:22 +02:00 committed by Patrick Ziegler
parent ef8f7c9d94
commit 0db8376222

View File

@ -76,8 +76,11 @@ namespace modules {
builder->node(m_labelseparator); builder->node(m_labelseparator);
builder->space(spacing); builder->space(spacing);
} }
for (auto&& item : m_levels[m_level]->items) { auto&& items = m_levels[m_level]->items;
builder->action(mousebtn::LEFT, item->exec, item->label); for (size_t i = 0; i < items.size(); i++) {
auto&& item = items[i];
builder->action(
mousebtn::LEFT, *this, string(EVENT_EXEC), to_string(m_level) + "-" + to_string(i), item->label);
if (item != m_levels[m_level]->items.back()) { if (item != m_levels[m_level]->items.back()) {
builder->space(spacing); builder->space(spacing);
if (*m_labelseparator) { if (*m_labelseparator) {