- 新增顶层 tuku/ 工程(package dev.tuku.app、二进制 tuku):app.c/internal 头/logic/ui 分层、app.json、build/pack 脚本 - 书库:从 TF 卡根浏览文件夹,含图目录=一本书;logic/library 纯 C 扫描+自然排序(page2<page10) - 流式缩略图:后台线程解码+meow_img_downscale(96),首帧/滚动不阻塞;磁盘缓存 MeowData/<pkg>/cache(mtime 失效+LRU) - 列表 meow_listview 虚拟化 + meow_scroll fling/snap;行=缩略图+目录名+页数 - 主题:全部语义色 + meow_theme_add_listener 即时重绘;明暗/风格族两态可读 - 导航:meow_view page push/pop、TopAppBar ⚙→设置;reader/settings/lock 最小桩 - 接缝:mr_reader_get/set_direction(默认 RTL)、lock_view_should_show()(桩 0) - 宿主 gcc 测试 46 项 PASS;交叉构建静态 MIPS32r2 ELF、-Wall -Wextra 零警告
56 lines
1.9 KiB
C
56 lines
1.9 KiB
C
/* 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);
|
||
}
|