mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-05-10 02:09:46 +08:00
refactor(ui): 提取UI常量到配置文件并重构全局变量
- 新增 config.h 集中管理所有UI常量,如窗口标题、尺寸、颜色等 - 将全局变量和控件指针移至 globals.c 进行统一管理 - 更新 Makefile 以包含新增的源文件 - 修改 ui.c 使用配置常量替代硬编码值,提高可维护性
This commit is contained in:
-20
@@ -7,27 +7,7 @@
|
||||
#include "ui.h"
|
||||
#include "cb_main.h"
|
||||
|
||||
// 全局控件定义
|
||||
Ihandle *dlg; // 主对话框
|
||||
Ihandle *tabs_main; // 主选项卡
|
||||
Ihandle *list_sys, *list_user, *list_merged; // 列表控件
|
||||
Ihandle *lbl_status; // 状态栏
|
||||
Ihandle *btn_new, *btn_edit, *btn_browse, *btn_del, *btn_up, *btn_down; // 右侧按钮
|
||||
Ihandle *btn_undo, *btn_redo; // 撤销重做按钮
|
||||
Ihandle *btn_import, *btn_export; // 导入导出按钮
|
||||
Ihandle *btn_ok, *btn_cancel, *btn_help; // 确认取消帮助按钮
|
||||
Ihandle *btn_clean; // 一键清理按钮
|
||||
Ihandle *btn_theme; // 主题切换按钮
|
||||
Ihandle *txt_search; // 搜索框
|
||||
|
||||
// 历史记录栈
|
||||
HistoryStack undo_stack = {0};
|
||||
HistoryStack redo_stack = {0};
|
||||
|
||||
// 全局变量定义
|
||||
StringList raw_sys_paths = {0};
|
||||
StringList raw_user_paths = {0};
|
||||
int is_dark_mode = 0; // 默认浅色模式
|
||||
|
||||
// 主函数
|
||||
int main(int argc, char **argv)
|
||||
|
||||
Reference in New Issue
Block a user