fix(settings): apply a theme as soon as it is selected and restore it on cancel

PLAN 5.6 asks for the theme to take effect immediately, but it was applied
only on OK. Selecting a theme now previews it; OK saves it, and cancel, Escape
or closing the window restores the theme the dialog opened with.
This commit is contained in:
doyaGu committed 2026-10-03 09:12:36 -04:00
1 parent 1ecb48316d
commit 4a88033695
5 files changed
+109 -7

No files matched your search

+2 -1
View File
@@ -30,7 +30,8 @@
### A3 主题三态切换
- [ ] 设置 → 主题 亮色 / 暗色 / 跟随系统 依次切换:**即时生效**,无重启提示
- [ ] 设置 → 主题 亮色 / 暗色 / 跟随系统 依次切换:下拉框一选中就**即时生效**(无需点确认),无重启提示
- [ ] 切换主题后点取消、按 Esc 或点标题栏关闭:恢复为打开设置时的主题;重启后仍是原主题
- [ ] 每种主题下检查:主窗口、看板列与卡片、标签 tab、全部模态、全部错误页颜色完整切换,无亮底暗字/暗底亮字残留
- [ ] 标签徽章在两种主题下均显示原色(§5.9 例外),文字颜色保持可读
- [ ] 跟随系统:程序运行中切换 Windows 深浅色 → 程序跟随变化
+1 -1
View File
@@ -214,7 +214,7 @@ card_tags: (card_id, tag_id) 复合主键,双向 ON DELETE CASCADE
入口 = 顶部显示区域右侧"设置"按钮,承载各类全局设置:
- 语言选择(英文 / 简体中文),切换后显示"重启后生效"提示(提示文本本身为资源键)
- 主题选择(亮色 / 暗色 / 跟随系统),切换后**即时生效**,无重启提示(与语言项的行为差异)
- 主题选择(亮色 / 暗色 / 跟随系统),下拉框选中即**即时生效**(预览),无重启提示(与语言项的行为差异);点确认才写入配置,取消或关闭设置模态则恢复打开时的主题
- 四类确认开关(见 §5.5)
### 5.7 关于模态