nyx: Use color when battery voltage < 3200mV

For status bar and Battery Info.
This commit is contained in:
CTCaer
2019-12-08 01:32:26 +02:00
parent 65ee728939
commit 96bafd8bd7
2 changed files with 6 additions and 2 deletions

View File

@@ -828,7 +828,9 @@ static void _update_status_bar(void *params)
else
s_printf(label, "#FF3C28 -%d", (~batt_curr + 1) / 1000);
s_printf(label + strlen(label), " mA# (%d mV)", batt_volt);
bool voltage_empty = batt_volt < 3200;
s_printf(label + strlen(label), " mA# (%s%d mV%s)",
voltage_empty ? "FFF8000" : "", batt_volt, voltage_empty ? "#" : "");
lv_label_set_array_text(status_bar.battery_more, label, 64);
lv_obj_realign(status_bar.battery_more);