feat: can disable tooltip

This commit is contained in:
Alex
2019-02-22 11:35:26 +01:00
parent 331b28393a
commit 83a6475510
9 changed files with 34 additions and 12 deletions

View File

@ -18,7 +18,9 @@ auto waybar::modules::Cpu::update() -> void
// TODO: as creating dynamic fmt::arg arrays is buggy we have to calc both
auto cpu_load = getCpuLoad();
auto [cpu_usage, tooltip] = getCpuUsage();
label_.set_tooltip_text(tooltip);
if (tooltipEnabled()) {
label_.set_tooltip_text(tooltip);
}
label_.set_markup(fmt::format(format_,
fmt::arg("load", cpu_load), fmt::arg("usage", cpu_usage)));
}