状态栏正确闭环(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:
1 parent
2a6c4e97c5
commit
7300fc0a13
14 files changed
+731
-44
No files matched your search
@@ -19,7 +19,9 @@
|
||||
typedef struct meow_ui_feed {
|
||||
int batt; /* 电量 %,-1 未知 */
|
||||
int charging; /* 1 充电/满 0 放电 */
|
||||
int wifi_on; /* 1 网卡 up(operstate==up) */
|
||||
int wifi_on; /* 1 网卡 up(射频开) */
|
||||
int wifi_connected;/* 1 已关联 AP(operstate up);WiFi 图标分档用 */
|
||||
int wifi_level; /* 信号 dBm(<-1000=未知);≥-60 强 / -75 中 / 更弱弱 */
|
||||
int bt_seen; /* hci0 节点存在 */
|
||||
int bt_on; /* 实际上电 */
|
||||
int vol; /* 音量 0-100 */
|
||||
@@ -27,6 +29,55 @@ typedef struct meow_ui_feed {
|
||||
} meow_ui_feed;
|
||||
void meow_ui_sys_feed(const meow_ui_feed *f); /* 喂权威快照 + 置 force 重绘顶条 */
|
||||
|
||||
/* ---- 系统 UI 模式(「同一个状态栏」闭环,§3.1 / FRAMEWORK_DESIGN §10.2)----
|
||||
* 状态栏 = 系统级组件,仅系统进程(launcher)渲染。SDK 在 App 进程与 launcher 进程都链接,
|
||||
* 但顶条/提示线的**渲染**仅当本进程为系统 UI(launcher 置 system_mode=1)才进行;App 进程
|
||||
* 不渲染(meow_ui_sys_statusbar_active()/meow_ui_statusbar_height() 不受此开关影响 → App 仍
|
||||
* inset 28、热区可用,只是不画顶条、由 launcher 叠加)。launcher init 后调
|
||||
* meow_ui_sys_set_system_mode(1);App 保持默认 0。 */
|
||||
void meow_ui_sys_set_system_mode(int on); /* 1=本进程为系统 UI(渲染顶条/提示线) */
|
||||
int meow_ui_sys_render_enabled(void); /* 当前进程是否渲染系统顶条 */
|
||||
/* 把全局状态栏画进本进程 back_buf 顶部 MUI_SBAR_H 行(仅系统进程调用,见 render_enabled)。
|
||||
* launcher 的 App 前台叠加(launch_app 循环)直接调它 + 标脏顶条上屏。实现见 meow_ui_sys.c。 */
|
||||
void meow_ui_sys_statusbar_render(void);
|
||||
|
||||
/* ---- 状态栏 MD3 图标簇(meow_ui_sys.c 渲染右侧;位图在 SDK 侧 sb_icons.h)----
|
||||
* meow_ui_gfx.c 的 meow_gfx_blit_icon(idx,...) 用这些索引查 sb_icons[]。
|
||||
* 索引值与 launcher sb_icons.h 的 SB_I_* 一一对应(位图同源,勿改序)。 */
|
||||
#define MEOW_SB_ICON_WIFI 0
|
||||
#define MEOW_SB_ICON_BT 1
|
||||
#define MEOW_SB_ICON_BATT 2
|
||||
#define MEOW_SB_ICON_VOL 3
|
||||
#define MEOW_SB_ICON_BRIGHT 4
|
||||
#define MEOW_SB_ICON_WIFI_STRONG 5
|
||||
#define MEOW_SB_ICON_WIFI_MEDIUM 6
|
||||
#define MEOW_SB_ICON_WIFI_WEAK 7
|
||||
#define MEOW_SB_ICON_WIFI_NO 8
|
||||
#define MEOW_SB_ICON_WIFI_OFF 9
|
||||
#define MEOW_SB_ICON_BT_NO 10
|
||||
#define MEOW_SB_ICON_BT_CONN 11
|
||||
#define MEOW_SB_ICON_BT_DIS 12
|
||||
#define MEOW_SB_ICON_BT_SEARCH 13
|
||||
|
||||
/* 状态栏右下布局常量(与 launcher SB_* 对齐):图标右缘↔文字间隙 / 相邻项间隙 / 图标目标 ink 高 /
|
||||
* 右簇左缘相对时钟右缘安全间距 / 图标 ink 垂直中心(=状态栏文字中心,28px 栏约 14)。 */
|
||||
#define MEOW_SB_TGAP 6
|
||||
#define MEOW_SB_XGAP 10
|
||||
#define MEOW_SB_ICON_INK 16
|
||||
#define MEOW_SB_CLK_MARGIN 14
|
||||
#define MEOW_SB_ICON_CY 14
|
||||
#define MEOW_SB_ICON_SIZE 32 /* 图标槽宽(= sb_icons.h SB_ICON_SIZE,勿改序) */
|
||||
|
||||
/* 把第 idx 个 MD3 图标(sb_icons[])按 ink 等比 blit 进 back_buf;x=槽左缘、ink_h=目标 ink 高
|
||||
* (0=自然 ink,WiFi 强弱档用)、fg=24bit 前景、cy=ink 垂直中心线。见 meow_ui_gfx.c。 */
|
||||
void meow_gfx_blit_icon(int idx, int x, int y, int ink_h, uint32_t fg, int cy);
|
||||
|
||||
/* ---- 顶级主题风格族(§8.1.2,minimal):状态栏图标集/配色随 ui.style(md3/miuix)----
|
||||
* meow_ui_theme.c 实现:读 settings.conf 的 ui.style(md3→0 / miuix→1),缓存,随
|
||||
* meow_theme_reload() 重读。launcher settings 改 ui.style 后经 sb_sdk_refresh→theme_reload
|
||||
* →本值更新 → 状态栏图标集跟手切。公共版见 meow_ui.h(meow_ui_set_style/meow_ui_style)。 */
|
||||
int meow_ui_style(void);
|
||||
|
||||
/* ---- 主题(meow_ui_theme.c 提供)----
|
||||
* 重置主题缓存,使下一次 meow_theme_get() 重读 settings.conf(display.theme /
|
||||
* display.theme_mode / display.theme_dark_start|end)。launcher 在 statusbar 刷新前调用,
|
||||
|
||||
Reference in new issue
Block a user