Added additional fallback background
This commit is contained in:
@@ -51,6 +51,7 @@ lv_img_dsc_t *icon_payload;
|
||||
lv_img_dsc_t *icon_lakka;
|
||||
|
||||
lv_img_dsc_t *hekate_bg;
|
||||
lv_img_dsc_t *hekate_bg_etc;
|
||||
|
||||
lv_style_t btn_transp_rel, btn_transp_pr, btn_transp_tgl_rel, btn_transp_tgl_pr;
|
||||
lv_style_t ddlist_transp_bg, ddlist_transp_sel;
|
||||
@@ -1279,7 +1280,7 @@ static void _create_text_button(lv_theme_t *th, lv_obj_t *parent, lv_obj_t *btn,
|
||||
btn_onoff_rel_hos_style.body.empty = 1;
|
||||
|
||||
lv_style_copy(&btn_onoff_pr_hos_style, &btn_onoff_rel_hos_style);
|
||||
if (hekate_bg)
|
||||
if (hekate_bg || hekate_bg_etc)
|
||||
{
|
||||
btn_onoff_pr_hos_style.body.main_color = LV_COLOR_HEX(0xFFFFFF);
|
||||
btn_onoff_pr_hos_style.body.opa = 35;
|
||||
@@ -1546,7 +1547,7 @@ static lv_res_t _win_launch_close_action(lv_obj_t * btn)
|
||||
|
||||
lv_obj_del(win);
|
||||
|
||||
if (n_cfg.home_screen && !launch_bg_done && hekate_bg)
|
||||
if (n_cfg.home_screen && !launch_bg_done && (hekate_bg || hekate_bg_etc))
|
||||
{
|
||||
lv_obj_set_opa_scale_enable(launch_bg, true);
|
||||
lv_obj_set_opa_scale(launch_bg, LV_OPA_TRANSP);
|
||||
@@ -1568,10 +1569,10 @@ static lv_obj_t *create_window_launch(const char *win_title)
|
||||
win_bg_style.body.main_color = lv_theme_get_current()->bg->body.main_color;
|
||||
win_bg_style.body.grad_color = win_bg_style.body.main_color;
|
||||
|
||||
if (n_cfg.home_screen && !launch_bg_done && hekate_bg)
|
||||
if (n_cfg.home_screen && !launch_bg_done && (hekate_bg || hekate_bg_etc))
|
||||
{
|
||||
lv_obj_t *img = lv_img_create(lv_scr_act(), NULL);
|
||||
lv_img_set_src(img, hekate_bg);
|
||||
lv_img_set_src(img, hekate_bg ? hekate_bg : hekate_bg_etc);
|
||||
|
||||
launch_bg = img;
|
||||
}
|
||||
@@ -1581,7 +1582,7 @@ static lv_obj_t *create_window_launch(const char *win_title)
|
||||
|
||||
lv_obj_set_size(win, LV_HOR_RES, LV_VER_RES);
|
||||
|
||||
if (n_cfg.home_screen && !launch_bg_done && hekate_bg)
|
||||
if (n_cfg.home_screen && !launch_bg_done && (hekate_bg || hekate_bg_etc))
|
||||
{
|
||||
lv_style_copy(&win_header, lv_theme_get_current()->win.header);
|
||||
win_header.body.opa = LV_OPA_TRANSP;
|
||||
@@ -2036,7 +2037,7 @@ static void _create_tab_home(lv_theme_t *th, lv_obj_t *parent)
|
||||
|
||||
// Launch button.
|
||||
lv_obj_t *btn_launch = lv_btn_create(parent, NULL);
|
||||
if (hekate_bg)
|
||||
if (hekate_bg || hekate_bg_etc)
|
||||
{
|
||||
lv_btn_set_style(btn_launch, LV_BTN_STYLE_REL, &btn_transp_rel);
|
||||
lv_btn_set_style(btn_launch, LV_BTN_STYLE_PR, &btn_transp_pr);
|
||||
@@ -2260,8 +2261,18 @@ void nyx_check_ini_changes()
|
||||
}
|
||||
}
|
||||
|
||||
static lv_obj_t *nyx_main_bg_img;
|
||||
|
||||
static lv_res_t _show_hide_save_button(lv_obj_t *tv, uint16_t tab_idx)
|
||||
{
|
||||
// Swap main background: Home (tab 1) uses background.bmp, others use background_etc.bmp if present.
|
||||
if (nyx_main_bg_img && (hekate_bg || hekate_bg_etc))
|
||||
{
|
||||
lv_img_dsc_t *src = (tab_idx == 1) ? hekate_bg : (hekate_bg_etc ? hekate_bg_etc : hekate_bg);
|
||||
if (src)
|
||||
lv_img_set_src(nyx_main_bg_img, src);
|
||||
}
|
||||
|
||||
if (tab_idx == 4) // Options.
|
||||
{
|
||||
lv_btn_set_action(status_bar.mid, LV_BTN_ACTION_CLICK, _save_options_action);
|
||||
@@ -2384,15 +2395,16 @@ static void _nyx_main_menu(lv_theme_t * th)
|
||||
lv_cont_set_style(cnr, &base_bg_style);
|
||||
lv_obj_set_size(cnr, LV_HOR_RES, LV_VER_RES);
|
||||
|
||||
if (hekate_bg)
|
||||
if (hekate_bg || hekate_bg_etc)
|
||||
{
|
||||
lv_obj_t *img = lv_img_create(cnr, NULL);
|
||||
lv_img_set_src(img, hekate_bg);
|
||||
lv_img_set_src(img, hekate_bg ? hekate_bg : hekate_bg_etc);
|
||||
nyx_main_bg_img = img;
|
||||
}
|
||||
|
||||
// Add tabview page to screen.
|
||||
lv_obj_t *tv = lv_tabview_create(scr, NULL);
|
||||
if (hekate_bg)
|
||||
if (hekate_bg || hekate_bg_etc)
|
||||
{
|
||||
lv_tabview_set_style(tv, LV_TABVIEW_STYLE_BTN_PR, &tabview_btn_pr);
|
||||
lv_tabview_set_style(tv, LV_TABVIEW_STYLE_BTN_TGL_PR, &tabview_btn_tgl_pr);
|
||||
|
||||
Reference in New Issue
Block a user