MCPcopy Create free account
hub / github.com/Alexays/Waybar / update

Method update

src/modules/simpleclock.cpp:17–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17auto waybar::modules::Clock::update() -> void {
18 tzset(); // Update timezone information
19 auto now = std::chrono::system_clock::now();
20 auto localtime = fmt::localtime(std::chrono::system_clock::to_time_t(now));
21 auto text = fmt::format(fmt::runtime(format_), localtime);
22 label_.set_markup(text);
23
24 if (tooltipEnabled()) {
25 if (config_["tooltip-format"].isString()) {
26 auto tooltip_format = config_["tooltip-format"].asString();
27 auto tooltip_text = fmt::format(fmt::runtime(tooltip_format), localtime);
28 label_.set_tooltip_text(tooltip_text);
29 } else {
30 label_.set_tooltip_text(text);
31 }
32 }
33 // Call parent update
34 ALabel::update();
35}

Callers

nothing calls this directly

Calls 1

formatFunction · 0.85

Tested by

no test coverage detected