状态栏正确闭环(agent-142): 系统进程统一渲染+App不画+覆盖叠加+数据唯一+MD3图标式+主题换图标

- meow_ui_sys_set_system_mode: launcher置1才渲染, App默认0→不画状态栏; app_overlay_statusbar在launch_app循环~1s叠加28px顶条(不SIGSTOP App)
- 数据源唯一(launcher g_sys→meow_ui_sys_feed; wifi_level/batt/vol/bri/clock), 根治"launcher有亮度App没有"
- 右侧=MD3图标+变量值(statusbar_right_str文本退役→图标簇, 复用sb_icons.h/MEOW_SB_ICON_*/meow_gfx_blit_icon); 颜色随meow_theme
- ui.style换图标集(meow_ui_style/set_style读ui.style md3/miuix, MIUIx暂MD3占位)
- hello最小改动(redraw非全屏只清inset=28之下, 不冲系统顶条); 开放点: App不SIGSTOP/inset28/MIUIx占位/set_statusbar系统模式门
- meow_ui.a=3da5af7b launcher=a2b1c096 hello=67075741 0warning; 宿主test_sb_statusbar ALL PASS + render PPM目检(左时钟右亮度/WiFi/蓝牙/音量/电量)
- 遗留: 真机验证(无双画/数据一致/顶条叠加/inset/ui.style); 运行时fullscreen沉浸叠画待M3; MIUIx图标占位
This commit is contained in:
MeowOS committed 2026-08-30 19:32:40 +08:00
1 parent 2a6c4e97c5
commit 7300fc0a13
14 files changed
+731 -44

No files matched your search

+32
View File
@@ -31,6 +31,7 @@ static meow_theme_mode g_manual = MEOW_THEME_DARK; /* display.theme 解析出的
static int g_dark_start = 0; /* 深色时段开始(分钟 0-1439) */
static int g_dark_end = 0; /* 深色时段结束(分钟 0-1439) */
static int g_loaded = 0;
static int g_style = MEOW_STYLE_MD3; /* 顶级主题风格族(§8.1.2):默认 MD3 */
static meow_theme_listener g_listeners[8];
static int g_nlisteners = 0;
@@ -107,6 +108,15 @@ static void load_settings(void)
get_setting_int("display.theme_dark_start", &g_dark_start);
get_setting_int("display.theme_dark_end", &g_dark_end);
/* 顶级主题风格族(§8.1.2 minimal):ui.style 的 md3/miuix。读取缺失/未知 → 回退 MD3。
* 决定状态栏右侧图标集(§3.1 同一个状态栏);配色日/夜仍由 display.theme 现有解析管。 */
g_style = MEOW_STYLE_MD3;
if (get_setting_str("ui.style", buf, sizeof buf) == 0) {
const char *v = buf;
while (*v == ' ' || *v == '\t') v++;
if (!strncmp(v, "miuix", 5) || !strncmp(v, "miui", 4)) g_style = MEOW_STYLE_MIUIX;
}
}
/* 当前本地时刻的「当天第几分钟」(tm_hour*60+tm_min);供时段判定用(与 launcher s_now_min_of_day 一致)。 */
@@ -186,6 +196,28 @@ meow_theme meow_theme_defaults(meow_theme_mode m)
}
}
/* ---- §8.1.2 顶级主题风格族(minimal)----
* meow_ui_style() 返回当前 ui.style(读取走 load_settings,随 meow_theme_reload() 重读,
* 故 launcher 改 settings.conf 后经 sb_sdk_refresh→theme_reload 即跟手)。
* meow_ui_set_style() 记录 style(越界 clamp;同值忽略)并触发 reload/broadcast——供需要
* 显式切换的调用方(后续 launcher 设置页切换可改走此路径);状态栏图标集据此换集。 */
int meow_ui_style(void)
{
if (!g_loaded) { load_settings(); g_loaded = 1; }
return g_style;
}
void meow_ui_set_style(int style)
{
if (style < MEOW_STYLE_MD3) style = MEOW_STYLE_MD3;
if (style > MEOW_STYLE_MIUIX) style = MEOW_STYLE_MIUIX;
if (style == g_style) return;
g_style = style;
/* 触发下一帧按新 style 重绘:清 settings 缓存(下次 get 重读)不必要(style 已记录),
* 仅广播主题 listener(沿用 theme 广播机制,让控件/状态栏下一帧用新 style 重绘)。 */
broadcast();
}
void meow_theme_add_listener(meow_theme_listener cb)
{
if (!cb) return;