Files
hekate/nyx/nyx_gui/frontend/gui_emu_tools.c
niklascfw fed7f05831 Nyx: emuMMC Manage window, Tools UI, and misc updates
- Add gui_emu_tools: emuMMC Manage window with correct positioning (LV_PROTECT_PARENT + re-parent to win)
- Tools: single SD button (tap = SD partition manager, 3s hold = eMMC)
- Remove emuSD from Nyx UI (tabs, UMS, partition manager); keep bootloader emusd
- Shorten Create emuMMC description text by one character
- Storage/build/config and dependency updates

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-20 20:49:48 +01:00

51 lines
1.5 KiB
C

#include "gui_emu_tools.h"
#include "gui.h"
#include "gui_emummc_tools.h"
#include <libs/lvgl/lv_core/lv_obj.h>
#include <libs/lvgl/lv_core/lv_style.h>
#include <libs/lvgl/lv_objx/lv_cont.h>
#include <libs/lvgl/lv_objx/lv_win.h>
static lv_obj_t *_create_container(lv_obj_t *parent){
static lv_style_t h_style;
lv_style_copy(&h_style, &lv_style_transp);
h_style.body.padding.inner = 0;
h_style.body.padding.hor = 0;
h_style.body.padding.ver = 0;
lv_obj_t *h1 = lv_cont_create(parent, NULL);
lv_cont_set_style(h1, &h_style);
lv_cont_set_fit(h1, false, true);
lv_obj_set_width(h1, LV_HOR_RES - 62);
lv_obj_set_click(h1, false);
lv_cont_set_layout(h1, LV_LAYOUT_OFF);
return h1;
}
lv_res_t create_win_emu_tools(lv_obj_t *btn){
lv_obj_t *win = nyx_create_standard_window(SYMBOL_EDIT " emuMMC Manage");
static lv_style_t win_style_no_pad;
lv_style_copy(&win_style_no_pad, lv_win_get_style(win, LV_WIN_STYLE_CONTENT_BG));
win_style_no_pad.body.padding.hor = 0;
win_style_no_pad.body.padding.inner = 0;
lv_win_set_style(win, LV_WIN_STYLE_CONTENT_BG, &win_style_no_pad);
/* Create container on window; win's CHILD_CHG moves it to the page, so we protect and re-parent to win */
lv_obj_t *cont = _create_container(win);
lv_obj_set_protect(cont, LV_PROTECT_PARENT);
lv_obj_set_parent(cont, win);
lv_obj_set_height(cont, 572);
create_tab_emummc_tools(cont);
/* Align to content area; y offset works now because cont stays on win */
lv_obj_t *content = lv_win_get_content(win);
lv_obj_align(cont, content, LV_ALIGN_IN_TOP_MID, -20, 50);
return LV_RES_OK;
}