Merge pull request #4724 from hallvardnmbu/master

Allow tooltip formatting the CPU module.
This commit is contained in:
Alexis Rouillard
2026-07-03 22:04:34 +02:00
committed by GitHub
+8 -3
View File
@@ -58,9 +58,14 @@ auto waybar::modules::Cpu::update() -> void {
label_.set_markup(fmt::vformat(format, store)); label_.set_markup(fmt::vformat(format, store));
if (tooltipEnabled()) { if (tooltipEnabled()) {
if (config_["tooltip-format"].isString()) { std::string tooltip_format;
tooltip = config_["tooltip-format"].asString(); if (!state.empty() && config_["tooltip-format-" + state].isString()) {
label_.set_tooltip_markup(fmt::vformat(tooltip, store)); tooltip_format = config_["tooltip-format-" + state].asString();
} else if (config_["tooltip-format"].isString()) {
tooltip_format = config_["tooltip-format"].asString();
}
if (!tooltip_format.empty()) {
label_.set_tooltip_markup(fmt::vformat(tooltip_format, store));
} else { } else {
label_.set_tooltip_markup(tooltip); label_.set_tooltip_markup(tooltip);
} }