Skip to content

feat: 现代化主题、日志配色与主界面布局 - #3

Merged
brofea merged 28 commits into
masterfrom
ui
Aug 23, 2026
Merged

feat: 现代化主题、日志配色与主界面布局#3
brofea merged 28 commits into
masterfrom
ui

Conversation

@brofea

@brofea brofea commented Aug 22, 2026

Copy link
Copy Markdown
Owner

当前界面中的中性色、控件样式和日志等级颜色存在较多硬编码,深色环境下部分控件和属性面板的可读性也不够理想。本次变更以现有 WPF / Metrolib 架构为基础,对主题系统、日志配色、主界面布局和常用控件视觉进行统一升级。

主要变更

主题系统

  • 增加语义化颜色资源,包括表面、弱表面、主文字、次要文字、分隔线、标题栏和遮罩等。
  • 支持浅色、深色和跟随系统三种主题模式。
  • 主题切换无需重启应用,窗口、设置页、侧栏、弹出面板、日志区域和控件样式会即时更新。
  • 跟随系统模式读取 Windows 的应用主题设置,并在系统主题变化后自动刷新。
  • 主题模式和主题色支持持久化。
  • 兼容旧版本的 darkmode 配置,缺失或非法配置会安全回退到浅色模式。
  • 重新设计默认强调色,并继续保留用户自定义主题色。

日志等级配色

  • 为日志等级增加浅色和深色两套默认配色。
  • 重新调整 TRACE、DEBUG、INFO、WARNING、ERROR、FATAL 等等级之间的颜色层次和可读性。
  • 用户手动修改过的日志等级颜色会被标记为自定义,在主题切换时保持不变。
  • 旧配置中缺少自定义标记时,会根据保存的颜色与新的浅色默认值进行兼容判断。
  • 主题切换时,未自定义的日志等级会自动切换到对应主题的默认配色。
  • 通过替换冻结画刷引用的方式更新日志颜色,避免共享 WPF Freezable 画刷导致的跨线程访问问题。
  • 现有日志视图会在主题变化后刷新画刷,不改变日志分页、虚拟化、命中测试和渲染算法。

主界面和控件视觉

  • 将搜索框和 Find All 搜索框移动到日志查看区顶部工具栏,并统一两者的尺寸、间距和视觉样式。
  • 保留现有搜索、Find All 和快捷键行为,包括 Ctrl+FCtrl+Shift+FCtrl+ECtrl+Shift+N
  • 修复属性面板在深色主题下文字颜色不清晰的问题。
  • 增加统一的 Fluent 风格视觉资源,包括控件圆角、控件高度、字体层级和间距规范。
  • 更新按钮、切换按钮、文本框、复选框、下拉框、进度指示器及相关 Metrolib 控件的主题色和状态色。
  • 使用 DynamicResource 保证主题色和语义颜色可以实时更新。
  • 不引入新的 UI 框架或第三方依赖。

文档和开发辅助工具

  • 更新英文 README,并新增/完善简体中文 README。
  • 增加中英文文档之间的语言切换链接。
  • 新增确定性 demo 日志生成脚本,支持生成指定大小、固定随机种子的测试日志,方便验证大文件加载、搜索和日志等级显示。
  • 补充主题、设置持久化、日志颜色、画刷线程安全和 UI 行为相关测试。

brofea added 28 commits August 22, 2026 23:41
Derive Light, Dark, and System log-level defaults from the active theme.
Remove the persisted independent palette selector.
Add a settings action that restores #FF222280 and all seven default log colors.
Update localization, theming guidance, and regression coverage.
Use a theme-aware muted surface for filter toggle buttons.
Bind button text and filter icons to the neutral text brush so dark mode keeps them legible.
Replace the placeholder heading with a project overview and positioning.
Document core capabilities, use cases, the NEXT motivation, and currently available features.
Generate a reproducible synthetic UTF-8 log with mixed levels and structured fields.
Support exact target sizes, custom output paths, deterministic seeds, decimal MB units, and force replacement.
Write through a temporary file and validate the final byte size before publishing.
Translate the Chinese README content into English while keeping the badges, screenshot, feature structure, use cases, and project rationale aligned.

Add reciprocal language-switch links between README.md and README_zh-CN.md.
Place the language switcher inside each centered README header.

Keep the current language label plain and link only the alternate language in the [English | 简体中文] display.
@brofea brofea changed the title 重塑主界面布局、加入深色模式并统一 Fluent 控件风格 feat: 现代化主题、日志配色与主界面布局 Aug 23, 2026
@brofea
brofea merged commit 778f6e0 into master Aug 23, 2026
2 checks passed
@brofea
brofea deleted the ui branch August 23, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant