actions: Switch all modules over to new system

All modules now expose their actions as public static constants

Issues: The menu module no longer closes when an item is clicked (before
it would intercept any executed command and look if it matches one of
its exec commands)
This commit is contained in:
patrick96
2020-05-24 18:35:12 +02:00
committed by Patrick Ziegler
parent 816b73a95f
commit ae2350167b
31 changed files with 197 additions and 232 deletions

View File

@ -88,14 +88,14 @@ namespace modules {
string output{module::get_output()};
if (m_scroll) {
m_builder->cmd(mousebtn::SCROLL_UP, EVENT_SCROLLUP);
m_builder->cmd(mousebtn::SCROLL_DOWN, EVENT_SCROLLDOWN);
m_builder->action(mousebtn::SCROLL_UP, *this, EVENT_INC);
m_builder->action(mousebtn::SCROLL_DOWN, *this, EVENT_DEC);
}
m_builder->append(std::move(output));
m_builder->cmd_close();
m_builder->cmd_close();
m_builder->action_close();
m_builder->action_close();
return m_builder->flush();
}
@ -116,9 +116,9 @@ namespace modules {
bool backlight_module::input(string&& cmd) {
double value_mod{0.0};
if (cmd == EVENT_SCROLLUP) {
if (cmd == EVENT_INC) {
value_mod = 5.0;
} else if (cmd == EVENT_SCROLLDOWN) {
} else if (cmd == EVENT_DEC) {
value_mod = -5.0;
} else {
return false;