-
Notifications
You must be signed in to change notification settings - Fork 53
fix: fix scrollbar hide animation behavior #283
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
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
deepin-ci-robot
added a commit
to linuxdeepin/qt6integration
that referenced
this pull request
Oct 13, 2025
Synchronize source files from linuxdeepin/qt5integration. Source-pull-request: linuxdeepin/qt5integration#283
18202781743
reviewed
Oct 13, 2025
18202781743
reviewed
Oct 13, 2025
095149c to
2711dcd
Compare
deepin-ci-robot
added a commit
to linuxdeepin/qt6integration
that referenced
this pull request
Oct 13, 2025
Synchronize source files from linuxdeepin/qt5integration. Source-pull-request: linuxdeepin/qt5integration#283
2711dcd to
4904088
Compare
deepin-ci-robot
added a commit
to linuxdeepin/qt6integration
that referenced
this pull request
Oct 13, 2025
Synchronize source files from linuxdeepin/qt5integration. Source-pull-request: linuxdeepin/qt5integration#283
1. Fix scrollbar hide animation logic to properly handle mouse hover and press events 2. Change from setting property flag to directly restarting animation when scrollbar is hovered or pressed 3. Add condition to only restart animation when it's already running 4. This ensures smooth animation behavior when user interacts with scrollbar during hide animation fix: 修复滚动条隐藏动画行为 1. 修复滚动条隐藏动画逻辑,正确处理鼠标悬停和按下事件 2. 从设置属性标志改为在滚动条悬停或按下时直接重启动画 3. 添加条件,仅在动画运行时才重启动画 4. 确保用户在隐藏动画期间与滚动条交互时的平滑动画行为
4904088 to
333dde4
Compare
deepin-ci-robot
added a commit
to linuxdeepin/qt6integration
that referenced
this pull request
Oct 13, 2025
Synchronize source files from linuxdeepin/qt5integration. Source-pull-request: linuxdeepin/qt5integration#283
Contributor
deepin pr auto review这段代码的修改是关于滚动条动画控制的逻辑。我来分析一下这个改动: 语法逻辑
代码质量
代码性能
代码安全
建议改进
bool isAnimationRunning(const QStyleOptionSlider *scrollBar) {
QPropertyAnimation *animation = qobject_cast<QPropertyAnimation*>(scrollBar->widget()->property("_d_dtk_scrollbar_animation").value<QObject*>());
return animation && animation->state() == QAbstractAnimation::Running;
}
// 然后在原代码中使用:
if (isHoveredOrPressed && isAnimationRunning(scrollBar)) {
// ...
}
if (isHoveredOrPressed && st == QAbstractAnimation::Running) {
qDebug() << "Scrollbar animation is running, keeping visible";
// ...
}
if (isHoveredOrPressed && st && st == QAbstractAnimation::Running) {
// ...
}总体来说,这是一个合理的改进,使代码更加健壮和可靠。 |
18202781743
approved these changes
Oct 13, 2025
Contributor
|
[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 |
18202781743
pushed a commit
to linuxdeepin/qt6integration
that referenced
this pull request
Oct 13, 2025
Synchronize source files from linuxdeepin/qt5integration. Source-pull-request: linuxdeepin/qt5integration#283
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.
fix: 修复滚动条隐藏动画行为