Merge pull request #4724 from hallvardnmbu/master
Allow tooltip formatting the CPU module.
This commit is contained in:
+8
-3
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user