Skip to content

修复强调色注册表写入异常,并为悬浮窗动作添加可恢复支持与开关式 UI#77

Open
Programmer-MrWang wants to merge 3 commits into
mainfrom
codex/fix-switch-system-accent-color-action
Open

修复强调色注册表写入异常,并为悬浮窗动作添加可恢复支持与开关式 UI#77
Programmer-MrWang wants to merge 3 commits into
mainfrom
codex/fix-switch-system-accent-color-action

Conversation

@Programmer-MrWang
Copy link
Copy Markdown
Owner

Motivation

  • 修复“切换系统强调色”动作在写入注册表时因值类型与 RegistryValueKind.DWord 不匹配导致的 System.ArgumentException 崩溃问题。
  • 为“显示悬浮窗”动作增加自动化“恢复”能力,以便在启用恢复时可以将悬浮窗恢复到触发前的显示状态。
  • 将“显示悬浮窗”设置界面从复选框改为更直观的普通开关样式(Switch),以匹配预期的开/关语义。
  • 变更遵循仓库中已有的可恢复动作实现模式(例如 LoadTemporaryClassPlanAction)来保存并恢复触发前的快照。

Description

  • Actions/SwitchSystemAccentColorAction.cs 中将写入注册表的 DWORD 值从 uint 改为 unchecked((int)...),确保传入 RegistryKey.SetValue 的对象类型与 RegistryValueKind.DWord 匹配。
  • Actions/ShowFloatingWindowAction.cs 中新增 private static readonly ConcurrentDictionary<Guid,bool> PreviousStates,在 OnInvoke() 中当 IsRevertable 为真时按 ActionSet.Guid 记录触发前的 ShowFloatingWindow 状态,并实现 OnRevert() 从快照恢复该状态并调用 _floatingWindowService.UpdateWindowState()
  • Controls/ShowFloatingWindowSettingsControl.cs 中将 CheckBox 替换为 ToggleSwitch,并将绑定从 ToggleButton.IsCheckedProperty 更新为 ToggleSwitch.IsCheckedProperty,同时将显示文本从 Content 改为 Header
  • 引入 using System.Collections.Concurrent; 用于线程安全的快照存储,修改仅限上述三个文件。

Testing

  • 尝试运行 dotnet build SystemTools.csproj -v minimal 以构建项目,但在当前环境中失败,错误为 /bin/bash: dotnet: command not found,因此未能在容器内完成编译验证。
  • 未运行额外的自动化单元测试或 CI 流水线(无其他自动化测试在此环境中被执行)。

Codex Task

@Programmer-MrWang
Copy link
Copy Markdown
Owner Author

note:
“显示悬浮窗”行动UI/介绍
监测内存占用方式更正
强调色实现还是不对

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant