diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..6e85d682 Binary files /dev/null and b/.DS_Store differ diff --git a/nyx/README_RES.md b/nyx/README_RES.md index f4f54e37..efb8f287 100644 --- a/nyx/README_RES.md +++ b/nyx/README_RES.md @@ -17,4 +17,6 @@ The default system icons (`icon_switch.bmp` and `icon_payload.bmp`) can be repla The background must go to /bootloader/res/background.bmp +An optional second background, **background_etc.bmp**, can be placed in /bootloader/res/. If present, it is used for the About, Tools, Console Info, and Options tabs. The Home tab always uses background.bmp (or the theme color if no custom background). Same 1280 x 720 32-bit BMP format as the main background. + The icons can be utilized either via `[boot entries names]` -> `boot entries names.bmp` or by using `icon={sd path}` (preferred method), which should point at a bmp. diff --git a/nyx/nyx_gui/frontend/gui.c b/nyx/nyx_gui/frontend/gui.c index 3b8c158a..00b18eae 100644 --- a/nyx/nyx_gui/frontend/gui.c +++ b/nyx/nyx_gui/frontend/gui.c @@ -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); diff --git a/nyx/nyx_gui/frontend/gui.h b/nyx/nyx_gui/frontend/gui.h index beb5a222..2db45c52 100644 --- a/nyx/nyx_gui/frontend/gui.h +++ b/nyx/nyx_gui/frontend/gui.h @@ -61,6 +61,7 @@ extern lv_img_dsc_t *icon_payload; extern lv_img_dsc_t *icon_lakka; extern lv_img_dsc_t *hekate_bg; +extern lv_img_dsc_t *hekate_bg_etc; extern lv_style_t btn_transp_rel, btn_transp_pr, btn_transp_tgl_rel, btn_transp_tgl_pr; extern lv_style_t ddlist_transp_bg, ddlist_transp_sel; diff --git a/nyx/nyx_gui/frontend/gui_info.c b/nyx/nyx_gui/frontend/gui_info.c index 7b77e073..0b4241f6 100644 --- a/nyx/nyx_gui/frontend/gui_info.c +++ b/nyx/nyx_gui/frontend/gui_info.c @@ -2945,7 +2945,7 @@ void create_tab_info(lv_theme_t *th, lv_obj_t *parent) // Create Bootrom button. lv_obj_t *btn = lv_btn_create(h1, NULL); - if (hekate_bg) + if (hekate_bg || hekate_bg_etc) { lv_btn_set_style(btn, LV_BTN_STYLE_REL, &btn_transp_rel); lv_btn_set_style(btn, LV_BTN_STYLE_PR, &btn_transp_pr); @@ -3041,7 +3041,7 @@ void create_tab_info(lv_theme_t *th, lv_obj_t *parent) // Create eMMC button. lv_obj_t *btn5 = lv_btn_create(h2, NULL); - if (hekate_bg) + if (hekate_bg || hekate_bg_etc) { lv_btn_set_style(btn5, LV_BTN_STYLE_REL, &btn_transp_rel); lv_btn_set_style(btn5, LV_BTN_STYLE_PR, &btn_transp_pr); @@ -3073,7 +3073,7 @@ void create_tab_info(lv_theme_t *th, lv_obj_t *parent) // Create Battery button. lv_obj_t *btn7 = lv_btn_create(h2, NULL); - if (hekate_bg) + if (hekate_bg || hekate_bg_etc) { lv_btn_set_style(btn7, LV_BTN_STYLE_REL, &btn_transp_rel); lv_btn_set_style(btn7, LV_BTN_STYLE_PR, &btn_transp_pr); diff --git a/nyx/nyx_gui/frontend/gui_options.c b/nyx/nyx_gui/frontend/gui_options.c index 5629da94..983639c8 100644 --- a/nyx/nyx_gui/frontend/gui_options.c +++ b/nyx/nyx_gui/frontend/gui_options.c @@ -1453,7 +1453,7 @@ void create_tab_options(lv_theme_t *th, lv_obj_t *parent) // Create Auto Boot button. lv_obj_t *btn = lv_btn_create(sw_h2, NULL); - if (hekate_bg) + if (hekate_bg || hekate_bg_etc) { lv_btn_set_style(btn, LV_BTN_STYLE_REL, &btn_transp_rel); lv_btn_set_style(btn, LV_BTN_STYLE_PR, &btn_transp_pr); @@ -1504,7 +1504,7 @@ void create_tab_options(lv_theme_t *th, lv_obj_t *parent) lv_ddlist_set_action(ddlist, _autoboot_delay_action); lv_ddlist_set_selected(ddlist, h_cfg.bootwait); - if (hekate_bg) + if (hekate_bg || hekate_bg_etc) { lv_ddlist_set_style(ddlist, LV_DDLIST_STYLE_BG, &ddlist_transp_bg); lv_ddlist_set_style(ddlist, LV_DDLIST_STYLE_BGO, &ddlist_transp_bg); diff --git a/nyx/nyx_gui/frontend/gui_tools.c b/nyx/nyx_gui/frontend/gui_tools.c index 4e011605..113a03eb 100644 --- a/nyx/nyx_gui/frontend/gui_tools.c +++ b/nyx/nyx_gui/frontend/gui_tools.c @@ -1538,7 +1538,7 @@ static void _create_tab_tools_emmc_pkg12(lv_theme_t *th, lv_obj_t *parent) // Create Backup eMMC button. lv_obj_t *btn = lv_btn_create(h1, NULL); - if (hekate_bg) + if (hekate_bg || hekate_bg_etc) { lv_btn_set_style(btn, LV_BTN_STYLE_REL, &btn_transp_rel); lv_btn_set_style(btn, LV_BTN_STYLE_PR, &btn_transp_pr); @@ -1593,7 +1593,7 @@ static void _create_tab_tools_emmc_pkg12(lv_theme_t *th, lv_obj_t *parent) // Create Partition SD Card button. lv_obj_t *btn3 = lv_btn_create(h2, NULL); - if (hekate_bg) + if (hekate_bg || hekate_bg_etc) { lv_btn_set_style(btn3, LV_BTN_STYLE_REL, &btn_transp_rel); lv_btn_set_style(btn3, LV_BTN_STYLE_PR, &btn_transp_pr); @@ -1657,7 +1657,7 @@ static void _create_tab_tools_arc_autorcm(lv_theme_t *th, lv_obj_t *parent) // Create fix archive bit button. lv_obj_t *btn = lv_btn_create(h1, NULL); - if (hekate_bg) + if (hekate_bg || hekate_bg_etc) { lv_btn_set_style(btn, LV_BTN_STYLE_REL, &btn_transp_rel); lv_btn_set_style(btn, LV_BTN_STYLE_PR, &btn_transp_pr); @@ -1710,7 +1710,7 @@ static void _create_tab_tools_arc_autorcm(lv_theme_t *th, lv_obj_t *parent) // Create AutoRCM On/Off button. lv_obj_t *btn3 = lv_btn_create(h2, NULL); - if (hekate_bg) + if (hekate_bg || hekate_bg_etc) { lv_btn_set_style(btn3, LV_BTN_STYLE_REL, &btn_transp_rel); lv_btn_set_style(btn3, LV_BTN_STYLE_PR, &btn_transp_pr); @@ -1788,7 +1788,7 @@ void create_tab_tools(lv_theme_t *th, lv_obj_t *parent) tabview_style.body.padding.ver = LV_DPI / 8; lv_tabview_set_style(tv, LV_TABVIEW_STYLE_BTN_REL, &tabview_style); - 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); diff --git a/nyx/nyx_gui/nyx.c b/nyx/nyx_gui/nyx.c index 5a797fcc..a5cc7855 100644 --- a/nyx/nyx_gui/nyx.c +++ b/nyx/nyx_gui/nyx.c @@ -302,6 +302,8 @@ static void nyx_load_bg_icons() // Load background resource if any. hekate_bg = bmp_to_lvimg_obj("bootloader/res/background.bmp"); + // Load alternate background for non-Home tabs (About, Tools, Info, Options). + hekate_bg_etc = bmp_to_lvimg_obj("bootloader/res/background_etc.bmp"); } #define EXCP_EN_ADDR 0x4003FFFC