feat(ui): 重构设置界面为页面控制器架构

- 添加新的UI页面基础架构(ui_page.h),包含页面操作接口
- 创建设置页面控制器(ui_settings_controller.h/.c)来管理页面导航
- 实现具体的设置页面类型:根页面、BLE页面、主题页面
- 修改display_module.c以使用新的页面系统替代旧的状态机
- 移除过时的settings_ui.h头文件和相关状态结构
- 更新事件处理逻辑以使用页面指针而非状态数据传递
- 修改主界面实现以适配统一的页面接口标准
This commit is contained in:
2026-04-23 18:46:55 +08:00
parent fbdc5426be
commit 48968e7880
18 changed files with 828 additions and 625 deletions

View File

@@ -1,12 +1,10 @@
#ifndef BLINKY_SETTINGS_VIEW_EVENT_H_
#define BLINKY_SETTINGS_VIEW_EVENT_H_
#include <string.h>
#include <app_event_manager.h>
#include <app_event_manager_profiler_tracer.h>
#include "settings_ui.h"
#include "ui/ui_settings_page.h"
#ifdef __cplusplus
extern "C" {
@@ -14,22 +12,19 @@ extern "C" {
struct settings_view_event {
struct app_event_header header;
struct settings_ui_state state;
struct ui_settings_page *page;
bool animate;
};
APP_EVENT_TYPE_DECLARE(settings_view_event);
static inline void submit_settings_view_event(
const struct settings_ui_state *state)
static inline void submit_settings_view_event(struct ui_settings_page *page,
bool animate)
{
struct settings_view_event *event;
struct settings_view_event *event = new_settings_view_event();
if (state == NULL) {
return;
}
event = new_settings_view_event();
memcpy(&event->state, state, sizeof(event->state));
event->page = page;
event->animate = animate;
APP_EVENT_SUBMIT(event);
}