mirror of
https://github.com/polybar/polybar.git
synced 2026-03-01 13:50:06 +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
@ -72,9 +72,7 @@ namespace modules {
|
||||
bool date_module::build(builder* builder, const string& tag) const {
|
||||
if (tag == TAG_LABEL) {
|
||||
if (!m_dateformat_alt.empty() || !m_timeformat_alt.empty()) {
|
||||
builder->cmd(mousebtn::LEFT, EVENT_TOGGLE);
|
||||
builder->node(m_label);
|
||||
builder->cmd_close();
|
||||
builder->action(mousebtn::LEFT, *this, EVENT_TOGGLE, m_label);
|
||||
} else {
|
||||
builder->node(m_label);
|
||||
}
|
||||
@ -85,8 +83,8 @@ namespace modules {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool date_module::input(string&& cmd) {
|
||||
if (cmd != EVENT_TOGGLE) {
|
||||
bool date_module::input(string&& action) {
|
||||
if (action != EVENT_TOGGLE) {
|
||||
return false;
|
||||
}
|
||||
m_toggled = !m_toggled;
|
||||
|
||||
Reference in New Issue
Block a user