-
Notifications
You must be signed in to change notification settings - Fork 21
sync: from linuxdeepin/dtkdeclarative #316
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
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#543
Reviewer's GuideRefactored ScrollView.qml to synchronize with the upstream linuxdeepin/dtkdeclarative by updating imports, migrating to the QtQuick.Templates ScrollView, and integrating Deepin DTK scrollbars with custom sizing and positioning logic. Class diagram for refactored ScrollView.qml with DTK ScrollBarsclassDiagram
class T.ScrollView {
+implicitWidth
+implicitHeight
}
class D.ScrollBar {
+vertical
+horizontal
+parent
+x
+y
+width
+height
+active
}
T.ScrollView "1" o-- "1" D.ScrollBar : vertical
T.ScrollView "1" o-- "1" D.ScrollBar : horizontal
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot 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 |
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.
Hey there - I've reviewed your changes - here's some feedback:
- Double-check the implicitWidth/implicitHeight calculations to ensure edge cases (like varying content or inset sizes) are handled correctly.
- The vertical and horizontal ScrollBar ‘active’ bindings reference each other, creating a circular dependency; consider decoupling those to avoid binding loops.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Double-check the implicitWidth/implicitHeight calculations to ensure edge cases (like varying content or inset sizes) are handled correctly.
- The vertical and horizontal ScrollBar ‘active’ bindings reference each other, creating a circular dependency; consider decoupling those to avoid binding loops.
## Individual Comments
### Comment 1
<location> `src/qml/ScrollView.qml:18-23` </location>
<code_context>
+ implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+ contentHeight + topPadding + bottomPadding)
+
+ D.ScrollBar.vertical: D.ScrollBar {
+ parent: control
+ x: control.mirrored ? 0 : control.width - width
+ y: control.topPadding
+ height: control.availableHeight
+ active: control.D.ScrollBar.horizontal.active
+ }
+
</code_context>
<issue_to_address>
**question (bug_risk):** The vertical scrollbar's 'active' property references the horizontal scrollbar's 'active' state, which may be confusing.
Please verify if the vertical scrollbar should depend on the horizontal scrollbar's 'active' state. If independent control is intended, adjust the logic accordingly.
</issue_to_address>
### Comment 2
<location> `src/qml/ScrollView.qml:26-31` </location>
<code_context>
+ active: control.D.ScrollBar.horizontal.active
+ }
+
+ D.ScrollBar.horizontal: D.ScrollBar {
+ parent: control
+ x: control.leftPadding
+ y: control.height - height
+ width: control.availableWidth
+ active: control.D.ScrollBar.vertical.active
+ }
}
</code_context>
<issue_to_address>
**question (bug_risk):** The horizontal scrollbar's 'active' property references the vertical scrollbar's 'active' state, which may cause circular or unintended activation.
Consider refactoring to avoid circular dependencies between scrollbar 'active' states, or add documentation if synchronization is intended.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Synchronize source files from linuxdeepin/dtkdeclarative.
Source-pull-request: linuxdeepin/dtkdeclarative#543
Summary by Sourcery
Synchronize ScrollView.qml from upstream by migrating to QtQuick.Templates ScrollView, updating module imports, and integrating Deepin scrollbars with implicit sizing.
Enhancements: