Repository navigation
fix(ui): 修复下拉框选项悬停色过渡发灰及结束后残留 [Claude-Fable-5.2] - #50
Merged
Chiloven945 merged 1 commit intoNov 16, 2026
Merged
Conversation
选项背景淡出的目标色为透明黑 (0,0,0,0),从悬停色过渡时颜色分量 一并趋向黑色,中途呈现半透明深灰;淡入同理。此外过渡使用相对值 动画,每帧读回取整后的颜色再累加增量,舍入误差逐帧累积,结束时 无法精确回到目标值,留下一层淡色。 透明端改为保留颜色、仅透明度为 0,并改用绝对值的 NColorFromToAnimation,每帧直接写入插值结果。 Closes PCL-Community#38
Chiloven945
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明 / Summary
下拉框选项(
MyComboBoxItem)的背景色过渡有两个问题,对应 issue 中的“滞后”和“残留”:(0,0,0,0)。从悬停色淡出时,RGB 与 Alpha 一起插值,中途变成半透明的深灰,在浅色主题的白底上很明显,看起来像高亮拖在鼠标后面。淡入时同理,是从透明黑开始的。ColorAnimation,每帧读回已取整的颜色、加上增量、再取整写回,舍入误差逐帧累积,动画结束时到不了目标值,留下一层淡色。帧数越多(刷新率越高)误差越大。修改:
NColorFromToAnimation(From 当前色 → To 目标色),每帧直接写入插值结果,不再累加。动画时长(淡入 100ms、淡出 300ms)、悬停色与选中色均未改动。
关联 Issue / Related Issue
Closes #38
验证方式 / Verification
构建
dotnet publish PCL.Launcher/PCL.Launcher.csproj -c Debug -r win-x64 --no-self-contained -p:Platform=x64,编译通过运行测试(Windows 11 x64,60Hz)
展开“设置 → 启动 → 启动器可见性”下拉框,用脚本移动鼠标并截图,读取各选项行的像素颜色。
浅色主题:
深色主题:修复前划过的行结束后为 (39,39,39),背景为 (40,40,40);修复后均为 (40,40,40)。
运行测试(Windows 11 x64,240Hz,浅色主题)
同样的步骤在 240Hz 显示器上再测一遍,修复前的偏差比 60Hz 下更大:
60Hz 下结束后的残留为 1~2 个色阶,240Hz 下为 5 个色阶,且悬停色本身也偏离目标值,与“舍入误差随帧数累积”一致。
对比截图见下方(第一张为 60Hz,第二张为 240Hz)。

未覆盖
说明
InputAnimation.AnimateColor等处使用同样的方式。本 PR 只修改了 issue 涉及的MyComboBoxItem,未改动公共动画代码。AI 使用情况 / Generative Artificial Intelligence Usage
PCL.Launcher/UI/Controls/Inputs/MyComboBoxItem.cs提交前检查 / Checklist
此PR由claude编写,本人已阅读并确认。