feat(bt): 批③后台管理页 — bg_page(顶栏'后台'入口+sub_page_t列表[名字/CPU/内存/状态/tap=kill]+一键清除动作行+空态,2s实时)+meow_bgmgr(collect/can_kill !framework门控+kill_all不杀框架)+meow_bg_terminate复用回收序列;amsd FG/BG收编(重编57e19cde含handle_bg/fg);test_bgmgr 20项ALL PASS,0warning
This commit is contained in:
1 parent
2f22e26de7
commit
211c5a556a
9 files changed
+624
-1
No files matched your search
@@ -94,11 +94,32 @@ static void menu_after_app_exit(int app_ran)
|
||||
* background then calls draw_header_content. The menu is pre-drawn before
|
||||
* fb_norm_buf0 so the initial pan shows a complete frame. */
|
||||
static int menu_title_size(void); /* 前向声明:draw_header_content 用(定义在下方布局帮助块) */
|
||||
static uint32_t menu_contrast(uint32_t c); /* 前向声明(定义在下方布局帮助块) */
|
||||
|
||||
/* 批③:桌面顶栏居右「后台管理」按钮(图标 tile + 字块)。命中区见 BGMR_BTN_*。 */
|
||||
#define BGMR_BTN_S 46 /* 按钮边长 */
|
||||
#define BGMR_BTN_X0 (fb_xres - BGMR_BTN_S - 14) /* 右缘留 14px 边距 */
|
||||
#define BGMR_BTN_Y0 40 /* 顶缘(标题行内,apps 区之上) */
|
||||
static void menu_draw_bgm_btn(const meow_ui_theme_t *th)
|
||||
{
|
||||
int x = BGMR_BTN_X0, y = BGMR_BTN_Y0, s = BGMR_BTN_S;
|
||||
fill_rect(x, y, s, s, th->primary);
|
||||
const char *lab = meow_str_zh("bgmgr.topbtn", "后台");
|
||||
int tw = meow_ui_text_width(lab, 14);
|
||||
ui_draw(x + (s - tw) / 2, y + (s - meow_font_line_height(14)) / 2, lab,
|
||||
menu_contrast(th->primary), 14);
|
||||
}
|
||||
static int menu_hit_bgm_btn(int tx, int ty)
|
||||
{
|
||||
return (tx >= BGMR_BTN_X0 && tx < BGMR_BTN_X0 + BGMR_BTN_S &&
|
||||
ty >= BGMR_BTN_Y0 && ty < BGMR_BTN_Y0 + BGMR_BTN_S);
|
||||
}
|
||||
|
||||
static void draw_header_content(void)
|
||||
{
|
||||
draw_statusbar();
|
||||
const meow_ui_theme_t *th = s_ui_theme();
|
||||
menu_draw_bgm_btn(th); /* 批③:顶栏居右「后台管理」按钮 */
|
||||
int tsize = menu_title_size(); /* 标题字号接 font.size.title */
|
||||
/* M2.6 标题真字体(字号接 font.size.title;回退点阵3x);MD3 on_surface 主文字色 */
|
||||
if (mfont_ready) {
|
||||
@@ -1812,6 +1833,26 @@ static void run_menu(struct app apps[MAX_APPS], int napps, int state,
|
||||
if (adx >= MENU_SWIPE_THRESH || ady >= MENU_SWIPE_THRESH) {
|
||||
logmsg("menu swipe (dx=%d,dy=%d) — no launch", dx, dy);
|
||||
} else if (tx >= 0 && ty >= 0) {
|
||||
/* 批③:顶栏居右「后台管理」按钮(最高优先级;阻挡非阻塞,返回后重画) */
|
||||
if (menu_hit_bgm_btn(tx, ty)) {
|
||||
logmsg("menu: touch topbar bg-manager button");
|
||||
menu_arm_touch(TAP_ARM_DELAY_MS); /* 幽灵触摸防护 */
|
||||
run_bg_page(apps, napps);
|
||||
memset(&kd_pwr, 0, sizeof kd_pwr);
|
||||
memset(&kd_vold, 0, sizeof kd_vold);
|
||||
memset(&kd_volu, 0, sizeof kd_volu);
|
||||
memset(&kd_play, 0, sizeof kd_play);
|
||||
kp_poll(&kp_power, NULL, NULL);
|
||||
kp_poll(&kp_keys, NULL, NULL);
|
||||
m_prev_pwr = kp_is_down(&kp_power, KEY_POWER);
|
||||
m_prev_vold = kp_is_down(&kp_keys, KEY_VOLUMEDOWN);
|
||||
m_prev_volu = kp_is_down(&kp_keys, KEY_VOLUMEUP);
|
||||
m_prev_play = kp_is_down(&kp_keys, KEY_PLAYPAUSE);
|
||||
last_input_ms = now_ms();
|
||||
menu_arm_touch(800);
|
||||
dirty = 1;
|
||||
continue;
|
||||
}
|
||||
if (ty >= EXIT_ROW - 4 && ty < EXIT_ROW + ROW_H - 8) {
|
||||
logmsg("menu: touch exit row");
|
||||
if (meow_mode) {
|
||||
|
||||
Reference in new issue
Block a user