mirror of
https://github.com/CTCaer/hekate.git
synced 2024-12-24 12:14:11 +00:00
nyx: Use color when battery voltage < 3200mV
For status bar and Battery Info.
This commit is contained in:
parent
65ee728939
commit
96bafd8bd7
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user