all repos — tint2 @ ea0e52c5a2e1c30f006bd9aef97fadd195395dd6

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Battery format fixes
o9000 mrovi9000@gmail.com
commit

ea0e52c5a2e1c30f006bd9aef97fadd195395dd6

parent

b5578ff5bc3302b975e0f1418ef778d9168dc73c

1 files changed, 6 insertions(+), 7 deletions(-)

jump to
M src/battery/battery.csrc/battery/battery.c

@@ -170,7 +170,9 @@ (battery_state.state == BATTERY_CHARGING)

? "Charging" : (battery_state.state == BATTERY_DISCHARGING) ? "Discharging" - : (battery_state.state == BATTERY_FULL) ? "Full" : "Unknown", + : (battery_state.state == BATTERY_FULL || battery_state.percentage >= 100) + ? "Full" + : "Unknown", BATTERY_BUF_SIZE); break; case 'm':

@@ -186,7 +188,8 @@ snprintf(buf, sizeof(buf), "%d%%", battery_state.percentage);

strnappend(dest, buf, BATTERY_BUF_SIZE); break; case 't': - if (battery_state.state == BATTERY_FULL) { + if (battery_state.state == BATTERY_FULL || + (battery_state.state == BATTERY_UNKNOWN && battery_state.percentage >= 100)) { snprintf(buf, sizeof(buf), "Full"); strnappend(dest, buf, BATTERY_BUF_SIZE); } else {

@@ -386,11 +389,7 @@

int battery_compute_desired_size(void *obj) { Battery *battery = (Battery *)obj; - return text_area_compute_desired_size(&battery->area, - buf_bat_line1, - buf_bat_line2, - bat1_font_desc, - bat2_font_desc); + return text_area_compute_desired_size(&battery->area, buf_bat_line1, buf_bat_line2, bat1_font_desc, bat2_font_desc); } gboolean resize_battery(void *obj)