mirror of
https://github.com/polybar/polybar.git
synced 2026-03-01 05:19:54 +00:00
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:
committed by
Patrick Ziegler
parent
816b73a95f
commit
ae2350167b
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user