perf(label): skip redundant markup updates
This commit is contained in:
@@ -98,7 +98,7 @@ void waybar::modules::MPD::setLabel() {
|
||||
? config_["format-disconnected"].asString()
|
||||
: "disconnected";
|
||||
if (format.empty()) {
|
||||
label_.set_markup(format);
|
||||
setLabelMarkup(format);
|
||||
label_.show();
|
||||
} else {
|
||||
label_.hide();
|
||||
@@ -110,7 +110,7 @@ void waybar::modules::MPD::setLabel() {
|
||||
? config_["tooltip-format-disconnected"].asString()
|
||||
: "MPD (disconnected)";
|
||||
// Nothing to format
|
||||
label_.set_tooltip_markup(tooltip_format);
|
||||
setTooltipMarkup(tooltip_format);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -190,7 +190,7 @@ void waybar::modules::MPD::setLabel() {
|
||||
label_.hide();
|
||||
} else {
|
||||
label_.show();
|
||||
label_.set_markup(text);
|
||||
setLabelMarkup(text);
|
||||
}
|
||||
} catch (fmt::format_error const& e) {
|
||||
spdlog::warn("mpd: format error: {}", e.what());
|
||||
@@ -210,7 +210,7 @@ void waybar::modules::MPD::setLabel() {
|
||||
fmt::arg("stateIcon", stateIcon), fmt::arg("consumeIcon", consumeIcon),
|
||||
fmt::arg("randomIcon", randomIcon), fmt::arg("repeatIcon", repeatIcon),
|
||||
fmt::arg("singleIcon", singleIcon), fmt::arg("filename", filename), fmt::arg("uri", uri));
|
||||
label_.set_tooltip_markup(tooltip_text);
|
||||
setTooltipMarkup(tooltip_text);
|
||||
} catch (fmt::format_error const& e) {
|
||||
spdlog::warn("mpd: format error (tooltip): {}", e.what());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user