-
Notifications
You must be signed in to change notification settings - Fork 55
fix: prevent time text flickering on hover #1287
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
deepin pr auto review我对这个代码变更进行审查:
改进建议:
property bool showTime: !root.closeVisible && !closePlaceHolder.hovered
Loader {
id: time
active: showTime
visible: active
Layout.alignment: Qt.AlignRight
sourceComponent: Text { ... }
}这样的修改可以使代码更加清晰和易于维护,同时保持原有的功能和性能优势。 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the time loader activation logic in NotifyItemContent.qml by adding a check that the close placeholder is not hovered, preventing flicker of the time text when hovering over the close button area. Class diagram for NotifyItemContent.qml time loader activation logicclassDiagram
class NotifyItem {
+closeVisible: bool
}
class ClosePlaceHolder {
+hovered: bool
}
class TimeLoader {
+active: bool
+visible: bool
}
NotifyItem --> ClosePlaceHolder : contains
NotifyItem --> TimeLoader : contains
TimeLoader : active = !NotifyItem.closeVisible && !ClosePlaceHolder.hovered
TimeLoader : visible = active
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.
| Loader { | ||
| id: time | ||
| active: !root.closeVisible | ||
| active: !root.closeVisible && !closePlaceHolder.hovered |
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.
关闭按钮有焦点是不是也不应该显示time?
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.
目前关闭按钮有焦点的效果是就是这样 就是没有显示time了。
|
[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 |
Fix time text flickering issue by ensuring time loader is only active when close button is not visible AND close placeholder is not hovered. Previously, the time text would disappear and reappear when hovering over the close button area due to incorrect activation logic. The change adds an additional condition to check if closePlaceHolder.hovered is false before activating the time loader, providing more stable visual behavior during hover interactions. fix: 修复悬停时时间文本闪烁问题 修复时间文本闪烁问题,通过确保时间加载器仅在关闭按钮不可见且关闭占位符未 被悬停时激活。之前当鼠标悬停在关闭按钮区域时,时间文本会因激活逻辑不正确 而消失和重新出现。 此更改添加了一个额外条件来检查 closePlaceHolder.hovered 是否为 false 后 再激活时间加载器,为悬停交互提供更稳定的视觉行为。 PMS: BUG-336145
838773a to
0ab05f6
Compare
|
/forcemerge |
|
This pr force merged! (status: blocked) |
Fix time text flickering issue by ensuring time loader is only active when close button is not visible AND close placeholder is not hovered. Previously, the time text would disappear and reappear when hovering over the close button area due to incorrect activation logic.
The change adds an additional condition to check if closePlaceHolder.hovered is false before activating the time loader, providing more stable visual behavior during hover interactions.
fix: 修复悬停时时间文本闪烁问题
修复时间文本闪烁问题,通过确保时间加载器仅在关闭按钮不可见且关闭占位符未
被悬停时激活。之前当鼠标悬停在关闭按钮区域时,时间文本会因激活逻辑不正确
而消失和重新出现。
此更改添加了一个额外条件来检查 closePlaceHolder.hovered 是否为 false 后 再激活时间加载器,为悬停交互提供更稳定的视觉行为。
PMS: BUG-336145
Summary by Sourcery
Bug Fixes: