1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-12-23 08:32:04 +00:00

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);

View file

@ -886,7 +886,9 @@ static lv_res_t _create_window_battery_status(lv_obj_t *btn)
s_printf(txt_buf + strlen(txt_buf), "-%d mA\n", (~value + 1) / 1000);
max17050_get_property(MAX17050_VCELL, &value);
s_printf(txt_buf + strlen(txt_buf), "%d mV\n", value);
bool voltage_empty = value < 3200;
s_printf(txt_buf + strlen(txt_buf), "%s%d mV%s\n",
voltage_empty ? "FFF8000" : "", value, voltage_empty ? " (Empty!)#" : "");
max17050_get_property(MAX17050_OCVInternal, &value);
s_printf(txt_buf + strlen(txt_buf), "%d mV\n", value);