mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(custom): update on click/scroll
This commit is contained in:
parent
d5e8a37e63
commit
ff28de0482
@ -22,6 +22,8 @@ class Custom : public ALabel {
|
||||
void continuousWorker();
|
||||
void parseOutputRaw();
|
||||
void parseOutputJson();
|
||||
bool handleScroll(GdkEventScroll* e);
|
||||
bool handleToggle(GdkEventButton* const& e);
|
||||
|
||||
const std::string name_;
|
||||
std::string text_;
|
||||
|
@ -79,6 +79,18 @@ void waybar::modules::Custom::refresh(int sig /*signal*/) {
|
||||
}
|
||||
}
|
||||
|
||||
bool waybar::modules::Custom::handleScroll(GdkEventScroll* e) {
|
||||
auto ret = ALabel::handleScroll(e);
|
||||
thread_.wake_up();
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool waybar::modules::Custom::handleToggle(GdkEventButton* const& e) {
|
||||
auto ret = ALabel::handleToggle(e);
|
||||
thread_.wake_up();
|
||||
return ret;
|
||||
}
|
||||
|
||||
auto waybar::modules::Custom::update() -> void {
|
||||
// Hide label if output is empty
|
||||
if (config_["exec"].isString() && (output_.out.empty() || output_.exit_code != 0)) {
|
||||
|
Loading…
Reference in New Issue
Block a user