mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
style(battery): format
This commit is contained in:
parent
2fa581c7ea
commit
14ace24a26
@ -156,8 +156,7 @@ auto waybar::modules::Battery::update() -> void {
|
|||||||
if (tooltipEnabled()) {
|
if (tooltipEnabled()) {
|
||||||
std::string tooltip_text;
|
std::string tooltip_text;
|
||||||
if (time_remaining != 0) {
|
if (time_remaining != 0) {
|
||||||
std::string time_to = std::string("Time to ") +
|
std::string time_to = std::string("Time to ") + ((time_remaining > 0) ? "empty" : "full");
|
||||||
((time_remaining > 0) ? "empty" : "full");
|
|
||||||
tooltip_text = time_to + ": " + formatTimeRemaining(time_remaining);
|
tooltip_text = time_to + ": " + formatTimeRemaining(time_remaining);
|
||||||
} else {
|
} else {
|
||||||
tooltip_text = status;
|
tooltip_text = status;
|
||||||
@ -183,7 +182,9 @@ auto waybar::modules::Battery::update() -> void {
|
|||||||
event_box_.hide();
|
event_box_.hide();
|
||||||
} else {
|
} else {
|
||||||
event_box_.show();
|
event_box_.show();
|
||||||
label_.set_markup(fmt::format(
|
label_.set_markup(fmt::format(format,
|
||||||
format, fmt::arg("capacity", capacity), fmt::arg("icon", getIcon(capacity, state)), fmt::arg("time", formatTimeRemaining(time_remaining))));
|
fmt::arg("capacity", capacity),
|
||||||
|
fmt::arg("icon", getIcon(capacity, state)),
|
||||||
|
fmt::arg("time", formatTimeRemaining(time_remaining))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user