-
Notifications
You must be signed in to change notification settings - Fork 21
sync: from linuxdeepin/dtkdeclarative #293
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
|
[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 |
Reviewer's GuideThis PR updates ComboBox.qml by introducing dynamic width management across delegate, text field, background, and popup components—enabling flat-mode sizing, adding popup margins, and ensuring list items auto-resize to fit view width. Sequence diagram for dynamic width adjustment in ArrowListViewsequenceDiagram
participant ComboBox
participant Popup
participant ArrowListView
participant ListView
participant MenuItem
ComboBox->>Popup: Open popup
Popup->>ArrowListView: Initialize contentItem
ArrowListView->>ListView: Get item count
ArrowListView->>ArrowListView: refreshContentItemWidth()
loop For each item
ArrowListView->>ListView: itemAtIndex(i)
ArrowListView->>MenuItem: Set item.width = view.width
end
ArrowListView->>ArrowListView: onWidthChanged triggers refreshContentItemWidth()
ArrowListView->>ArrowListView: Connections onCountChanged triggers refreshContentItemWidth()
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.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `qt6/src/qml/ComboBox.qml:107` </location>
<code_context>
- Layout.fillWidth: true
+ Layout.fillWidth: !control.flat
Layout.fillHeight: true
+ implicitWidth: control.flat ? contentWidth : implicitBackgroundWidth + leftInset + rightInset
+ || contentWidth + leftPadding + rightPadding
Layout.rightMargin: DS.Style.comboBox.spacing
text: control.editable ? control.editText : control.displayText
</code_context>
<issue_to_address>
The implicitWidth assignment uses a chained logical OR, which may be error-prone.
Using '||' for fallback may result in unintended values if the first calculation is 0 or another falsy value. Please use a more explicit approach to ensure the correct width is assigned.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| implicitWidth: control.flat ? contentWidth : implicitBackgroundWidth + leftInset + rightInset | ||
| || contentWidth + leftPadding + rightPadding |
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.
issue: The implicitWidth assignment uses a chained logical OR, which may be error-prone.
Using '||' for fallback may result in unintended values if the first calculation is 0 or another falsy value. Please use a more explicit approach to ensure the correct width is assigned.
95ee1be to
62d12dd
Compare
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#521
62d12dd to
c6ff661
Compare
deepin pr auto review我对这个代码审查如下:
总体建议:
这些改进将使代码更加健壮、可维护,并提高性能。 |
Synchronize source files from linuxdeepin/dtkdeclarative.
Source-pull-request: linuxdeepin/dtkdeclarative#521
Summary by Sourcery
Synchronize ComboBox QML component updates from upstream to improve flat styling, dynamic sizing, and popup item layout.
Enhancements: