-
Notifications
You must be signed in to change notification settings - Fork 55
fix: improve text visibility logic in AnimationSettingButton #1270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR enhances accessibility by revising the AnimationSettingButton’s text visibility logic to display button labels not only on hover but also when the button receives keyboard focus, ensuring screen-reader and keyboard-only users can see the text. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Changed the textVisible property condition to include both hovered and activeFocus states instead of just hovered. This ensures that the button text remains visible when the button has keyboard focus, improving accessibility for users navigating with keyboard or screen readers. The previous implementation only showed text on hover, which made it difficult for keyboard-only users to see the button labels when navigating through focus. fix: 改进 AnimationSettingButton 中的文本可见性逻辑 将 textVisible 属性的条件从仅检查悬停状态改为同时检查悬停和焦点状态。这 确保了按钮在获得键盘焦点时文本仍然可见,提高了使用键盘或屏幕阅读器用户的 可访问性。 之前的实现仅在悬停时显示文本,这使得仅使用键盘导航的用户在通过焦点浏览时 难以看到按钮标签。 Pms: BUG-284477
0c5bbf2 to
18b71c9
Compare
deepin pr auto review我来审查这段代码的变更。这是一个QML文件,用于通知中心中的动画设置按钮。主要变更是在 语法逻辑分析变更前: property bool textVisible: root.hovered && text !== ""变更后: property bool textVisible: (root.hovered || root.activeFocus) && text !== ""这个变更在逻辑上是合理的,它扩展了文本可见的条件,不仅考虑了鼠标悬停状态( 代码质量
代码性能这个变更对性能的影响可以忽略不计,因为:
代码安全这个变更不会引入任何安全隐患,因为:
改进建议
总结这是一个很好的改进,提高了组件的可访问性,同时保持了代码的简洁性和性能。变更合理且安全,符合无障碍设计的原则。如果可能,可以考虑进一步添加动画效果和文档注释,使组件更加完善。 |
Changed the textVisible property condition to include both hovered and activeFocus states instead of just hovered. This ensures that the button text remains visible when the button has keyboard focus, improving accessibility for users navigating with keyboard or screen readers.
The previous implementation only showed text on hover, which made it difficult for keyboard-only users to see the button labels when navigating through focus.
fix: 改进 AnimationSettingButton 中的文本可见性逻辑
将 textVisible 属性的条件从仅检查悬停状态改为同时检查悬停和焦点状态。这
确保了按钮在获得键盘焦点时文本仍然可见,提高了使用键盘或屏幕阅读器用户的
可访问性。
之前的实现仅在悬停时显示文本,这使得仅使用键盘导航的用户在通过焦点浏览时
难以看到按钮标签。
Pms: BUG-284477
Summary by Sourcery
Bug Fixes: