/* ui/settings/settings.c — 设置页(ACT_SETTINGS)M3 骨架。 * * M5 在此实现 APP 启动 PIN 等设置项;本批只落可编译桩,入口为书库 TopAppBar ⚙。 * 返回:左缘返回(app.c SWIPE_LEFT → page_pop)。 */ #include "tuku_internal.h" static mr_page_ctrl g_ctrl; static void settings_draw(meow_view *v, const meow_theme *th, void *ctx) { (void)v; (void)ctx; int w = meow_ui_width(); int sb = meow_ui_statusbar_height(); meow_ui_fill_rect(0, sb, w, 56, th->surfaceContainer); meow_ui_text(w / 2, sb + 16, "Settings", th->font_title, th->onSurface); meow_ui_text_center(w / 2, sb + 100, "APP options", th->font_body, th->onSurfaceVariant); meow_ui_text_center(w / 2, sb + 140, "Startup PIN — M5", th->font_body, th->onSurface); meow_ui_text_center(w / 2, sb + 180, "Reader direction — M4", th->font_body, th->onSurface); meow_ui_text_center(w / 2, sb + 240, "Theme follows the system automatically", th->font_body, th->onSurfaceVariant); meow_ui_text_center(w / 2, sb + 300, "left-edge swipe = back", th->font_body, th->onSurfaceVariant); } static void settings_page_enter(meow_view *v, void *ctx) { ((mr_page_ctrl *)ctx)->active = 1; v->x = 0; v->y = 0; v->w = meow_ui_width(); v->h = meow_ui_height(); meow_ui_set_fullscreen(0); meow_ui_set_page_bg(meow_theme_get()->bg); mr_nav_report(); meow_ui_paint_full(); } static void settings_page_leave(meow_view *v, void *ctx) { (void)v; ((mr_page_ctrl *)ctx)->active = 0; } meow_view *settings_view_create(void) { static const meow_view_hooks h = { .on_enter = settings_page_enter, .on_leave = settings_page_leave, .on_draw = settings_draw, }; return meow_view_create(ACT_SETTINGS, MEOW_VIEW_ACTIVITY, &h, &g_ctrl); }