battery: use timeTo as the default format name

pull/830/head
Marek Černoch 2021-01-18 12:32:51 +01:00
parent fdaba72974
commit ce0bf6269b
No known key found for this signature in database
GPG Key ID: A87AA03048376E4F
1 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,7 @@ auto waybar::modules::Battery::update() -> void {
auto time_remaining_formatted = formatTimeRemaining(time_remaining); auto time_remaining_formatted = formatTimeRemaining(time_remaining);
if (tooltipEnabled()) { if (tooltipEnabled()) {
std::string tooltip_text_default; std::string tooltip_text_default;
std::string tooltip_format = "{autoTooltip}"; std::string tooltip_format = "{timeTo}";
if (time_remaining != 0) { if (time_remaining != 0) {
std::string time_to = std::string("Time to ") + ((time_remaining > 0) ? "empty" : "full"); std::string time_to = std::string("Time to ") + ((time_remaining > 0) ? "empty" : "full");
tooltip_text_default = time_to + ": " + time_remaining_formatted; tooltip_text_default = time_to + ": " + time_remaining_formatted;
@ -270,7 +270,7 @@ auto waybar::modules::Battery::update() -> void {
tooltip_format = config_["tooltip-format"].asString(); tooltip_format = config_["tooltip-format"].asString();
} }
label_.set_tooltip_text(fmt::format(tooltip_format, label_.set_tooltip_text(fmt::format(tooltip_format,
fmt::arg("autoTooltip", tooltip_text_default), fmt::arg("timeTo", tooltip_text_default),
fmt::arg("capacity", capacity), fmt::arg("capacity", capacity),
fmt::arg("time", time_remaining_formatted))); fmt::arg("time", time_remaining_formatted)));
} }