mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-30 02:25:55 +08:00
feat(ui): 添加深色模式支持
- 新增深色/浅色模式切换按钮,位于主窗口底部 - 在配置文件中定义主题颜色(浅色/深色背景、列表背景、前景色) - 更新 UI 工具函数以支持动态主题切换,包括列表斑马纹适配 - 添加翻译条目(Dark Mode/Light Mode)并更新编译脚本 - 修改主窗口创建逻辑,集成主题切换回调 - 调整列表背景色属性从 BACKCOLOR 改为 BGCOLOR 以保持一致性
This commit is contained in:
@@ -63,6 +63,14 @@ static const char *get_string_default(const char *section, const char *key)
|
||||
return "取消";
|
||||
if (strcmp(key, "help") == 0)
|
||||
return "帮助(?)";
|
||||
if (strcmp(key, "undo") == 0)
|
||||
return "撤销";
|
||||
if (strcmp(key, "redo") == 0)
|
||||
return "重做";
|
||||
if (strcmp(key, "darkmode") == 0)
|
||||
return "深色模式";
|
||||
if (strcmp(key, "lightmode") == 0)
|
||||
return "浅色模式";
|
||||
}
|
||||
else if (strcmp(section, "label") == 0)
|
||||
{
|
||||
@@ -74,11 +82,32 @@ static const char *get_string_default(const char *section, const char *key)
|
||||
return "系统变量 (System)";
|
||||
if (strcmp(key, "tab_user") == 0)
|
||||
return "用户变量 (User)";
|
||||
if (strcmp(key, "tab_merged") == 0)
|
||||
return "合并预览";
|
||||
if (strcmp(key, "export_title") == 0)
|
||||
return "导出 PATH";
|
||||
if (strcmp(key, "import_title") == 0)
|
||||
return "导入 PATH";
|
||||
}
|
||||
else if (strcmp(section, "theme") == 0)
|
||||
{
|
||||
if (strcmp(key, "light_bg") == 0)
|
||||
return "240 240 240";
|
||||
if (strcmp(key, "light_list_bg") == 0)
|
||||
return "255 255 255";
|
||||
if (strcmp(key, "light_list_alt") == 0)
|
||||
return "245 245 245";
|
||||
if (strcmp(key, "light_fg") == 0)
|
||||
return "0 0 0";
|
||||
if (strcmp(key, "dark_bg") == 0)
|
||||
return "30 30 30";
|
||||
if (strcmp(key, "dark_list_bg") == 0)
|
||||
return "40 40 40";
|
||||
if (strcmp(key, "dark_list_alt") == 0)
|
||||
return "50 50 50";
|
||||
if (strcmp(key, "dark_fg") == 0)
|
||||
return "220 220 220";
|
||||
}
|
||||
else if (strcmp(section, "layout") == 0)
|
||||
{
|
||||
if (strcmp(key, "vbox_gap") == 0)
|
||||
|
||||
Reference in New Issue
Block a user