nyx: Allow hue icons from section names

This commit is contained in:
CTCaer 2020-05-05 19:01:08 +03:00
parent c7ab404fc1
commit f56d1bad04
2 changed files with 13 additions and 10 deletions

View file

@ -1293,7 +1293,7 @@ static lv_res_t _win_launch_close_action(lv_obj_t * btn)
lv_img_dsc_t *src = (lv_img_dsc_t *)lv_img_get_src(img); lv_img_dsc_t *src = (lv_img_dsc_t *)lv_img_get_src(img);
// Avoid freeing base icons. // Avoid freeing base icons.
if ((src != icon_switch) && (src != icon_payload) && (src != icon_lakka)) if ((src != icon_switch) && (src != icon_payload))
free(src); free(src);
} }
} }
@ -1576,9 +1576,13 @@ ini_parsing:
bmp = bmp_to_lvimg_obj(tmp_path); bmp = bmp_to_lvimg_obj(tmp_path);
if (!bmp) if (!bmp)
{ {
if (!strcmp(ini_sec->name, "Lakka")) s_printf(tmp_path, "bootloader/res/%s_hue.bmp", ini_sec->name);
bmp = icon_lakka; bmp = bmp_to_lvimg_obj(tmp_path);
else if (payload) if (bmp)
img_colorize = true;
}
if (!bmp && payload)
{ {
bmp = icon_payload; bmp = icon_payload;
@ -1586,7 +1590,6 @@ ini_parsing:
img_colorize = true; img_colorize = true;
} }
} }
}
else else
{ {
bmp = bmp_to_lvimg_obj(icon_path); bmp = bmp_to_lvimg_obj(icon_path);

View file

@ -373,7 +373,7 @@ void nyx_init_load_res()
else else
icon_payload = bmp_to_lvimg_obj("bootloader/res/icon_payload_custom.bmp"); icon_payload = bmp_to_lvimg_obj("bootloader/res/icon_payload_custom.bmp");
icon_lakka = bmp_to_lvimg_obj("bootloader/res/icon_lakka.bmp"); // Load background resource if any.
hekate_bg = bmp_to_lvimg_obj("bootloader/res/background.bmp"); hekate_bg = bmp_to_lvimg_obj("bootloader/res/background.bmp");
sd_unmount(false); sd_unmount(false);