From a20a27c71eda4a9e799d4936745bf4ef829b9ce9 Mon Sep 17 00:00:00 2001 From: Niklas080208 Date: Sat, 31 Jan 2026 20:45:20 +0100 Subject: [PATCH] Added additional fallback background --- .DS_Store | Bin 0 -> 8196 bytes nyx/README_RES.md | 2 ++ nyx/nyx_gui/frontend/gui.c | 30 ++++++++++++++++++++--------- nyx/nyx_gui/frontend/gui.h | 1 + nyx/nyx_gui/frontend/gui_info.c | 6 +++--- nyx/nyx_gui/frontend/gui_options.c | 4 ++-- nyx/nyx_gui/frontend/gui_tools.c | 10 +++++----- nyx/nyx_gui/nyx.c | 2 ++ 8 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6e85d6828806e73d79440329aab24d78bf998896 GIT binary patch literal 8196 zcmeHMU2GIp6u#fIlo=<`*+QiZ$Szq$=`SuAV2DlBC<0Lg{tpqLGn+SgmUCaMMtu~4C<1q61o-nIK^Mn#1t$cCj}Gd> z5`d7G0AZss)d8VRqJrrPP6!N5X-`o-pkj(ji2-3w>j|z-n6BW2Kw-`x%o!?oMx{bQ zcz3c(gz5}wfl(htAd0}v5#Z@l$2?xSvymC~`}zEcWBWlW^*yAT+BtP|<+-vd@6R6b zMzettl>CfQ+{!gkLM4BNGep@D5$q_VHyc1>?I~4{ftz zK~`iXr!|d@wWLyO63rW0$JZprTG#XO#^&*HMQ%*4+q^q>)ERcYlfn&D9tCXP47X0r z^vUtd?c$w8O-t3MD^;JAyHs_a-rKjQe_$}DX(iv71>?~{w$3ZC0j zw94dKf5CG~!!E7F3WifCk+Rk1I9dBiptk9&(_&p8DCO;AB|A8wC1rWC zL5tO^dOV@X+Sz?3IkVF<`Hp6|qU-T{WqB``w-+tyg;>>BK0pRWuTQRtE!4FSDvIX! z9;L5Xn5yeH$ckq6IY!=cDx!xsk*KS`EIg|S8y}ICfr2+YOwRa1rl;FvS-Wt6-*|`N z2i+r^0v+@#aA1Fsl*-4)mMLB3U+X<8I#m`taHc%gu)o*!iQuoTO%?d$-h z)CqQqz0BTZpRlv+9Q%rW%PzBP>=$;O{m%YiH`t%3#XQtQLkv2WU@4YiHJZ_ajmV%2 zJFpYo=*4~#HW|42{kn3O*oJYf@u#4N~p?9KIzP@ z6Dq#-@on3?cKmM>>hkV>W6HfmLnkSk4|rCd}dmn_zsRCQUJGLwahnRrKBRG2@M6gD z(|8T9;|;uxcknLW!^b#_b2yJr@fp6vH~0=$aBT*YcTQ(Aew)eUa<=F?o_m<&RrXIe zxs7Kv!nY<~|98&*{{J?PK;&8!fhYo~?Z|dyC=Rnd0eP*Rpz9!Aym7q=fuRX?VL471 pmg9s|e;Cp@L8{y)UBL-~B%$`7zX%XNsH5{gI{$gOd&i#te*?wdSs(xa literal 0 HcmV?d00001 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