hello f45ba051→c06b3b4f; mipsel -Wall -Wextra 0 warning; 宿主 P1c/P2/P3+widgets 全 PASS 出入(诚实): view on_draw/on_event 路径暂未启用(注册表直绘已覆盖, on_draw 双画风险), 留批③实测; home/full 仍手绘未迁注册表
57 lines
1.8 KiB
C
57 lines
1.8 KiB
C
/* ui/full.c — 全屏页(ACT_FULL)view + 控制器。
|
||
*
|
||
* 无控件:进入时声明全屏+状态栏收合,绘制 accent 底 + 三行文本;点任意处/左缘左滑回 home。
|
||
* 页面切换由 meow_view_page_push/pop 驱动 on_enter/on_leave(activity_push/pop 在 page_push/pop 内)。
|
||
* 注:on_leave 里 activity_active() 仍为 ACT_FULL(activity_pop 在其后),故 OFF 日志的 activity
|
||
* id 与旧 set_fullscreen(0) 略异——纯诊断日志差异,功能无变化(见报告)。
|
||
*/
|
||
#include "hello_internal.h"
|
||
|
||
static full_ctrl g_full_ctrl;
|
||
static int g_full = 0; /* 1=处于全屏视图 */
|
||
|
||
void full_draw(void)
|
||
{
|
||
const meow_theme *th = meow_theme_get();
|
||
meow_ui_clear(th->accent);
|
||
meow_ui_text_center(240, 330, "FULLSCREEN ACTIVE", 28, 0xFFFFFF);
|
||
meow_ui_text_center(240, 366, "tap anywhere = back to home", 20, 0xFFFFFF);
|
||
meow_ui_text_center(240, 394, "(left-edge swipe also returns)", 20, 0xFFFFFF);
|
||
meow_ui_flush();
|
||
}
|
||
|
||
static void full_page_enter(meow_view *v, void *ctx)
|
||
{
|
||
(void)v;
|
||
((full_ctrl *)ctx)->active = 1;
|
||
g_full = 1;
|
||
meow_ui_set_fullscreen(1);
|
||
meow_ui_statusbar_set_collapsed(1);
|
||
full_draw();
|
||
meow_log(MEOW_LOG_INFO, "fullscreen ON (collapsed), activity->%d", meow_ui_activity_active());
|
||
}
|
||
|
||
static void full_page_leave(meow_view *v, void *ctx)
|
||
{
|
||
(void)v;
|
||
((full_ctrl *)ctx)->active = 0;
|
||
g_full = 0;
|
||
meow_ui_set_fullscreen(0);
|
||
meow_ui_statusbar_set_collapsed(0);
|
||
meow_log(MEOW_LOG_INFO, "fullscreen OFF (restore), activity->%d", meow_ui_activity_active());
|
||
}
|
||
|
||
int full_is_active(void)
|
||
{
|
||
return g_full;
|
||
}
|
||
|
||
meow_view *full_view_create(void)
|
||
{
|
||
static const meow_view_hooks h = {
|
||
.on_enter = full_page_enter,
|
||
.on_leave = full_page_leave,
|
||
};
|
||
return meow_view_create(ACT_FULL, MEOW_VIEW_ACTIVITY, &h, &g_full_ctrl);
|
||
}
|