fix(status-bar): 修复非激活桌面上百分比文字不变暗的问题 - #38
Merged
Merged
Conversation
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.
问题
在多显示器环境中,切换到另一块屏幕后,非激活屏幕上的菜单栏图标会变暗,但 CodexRunway 的百分比文字仍保持高亮,外观与周围状态项不一致。
原实现将自定义
StatusBarContentView叠加在状态栏按钮上,并使用NSColor.labelColor自行绘制百分比,没有接入原生状态栏按钮的非激活态渲染。修改
NSStatusBarButton.title,由 AppKit 处理文字颜色和菜单栏状态。--占位,宽度交由原生按钮自动计算。验证
swift test --filter StatusBar:19 项测试通过。swift run CodexRunway --self-check:执行成功。arm64 Release 构建成功;应用和 Widget 的包结构、ad-hoc 签名校验通过。
全量测试另有一项控制面板宽度断言失败:
ControlPanelTabBarTests.swift:50,实际为 552,预期为 546;单独运行也可复现,该测试未执行本次修改的状态栏逻辑。多显示器切换激活屏幕后的实机截图待补充。
效果对比
修复前
非激活屏幕上的其他菜单栏图标已经变暗,百分比文字仍保持高亮。
修复后(待补实拍)
预期:切换到另一块屏幕后,百分比文字随原生菜单栏一起变暗;回到该屏幕后恢复正常亮度。