-
Notifications
You must be signed in to change notification settings - Fork 50
fix: Modifying text beyond the scope of the control #430
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 GuideReplaced the default Label with DccLabel and updated its layout and text eliding settings to prevent overflow beyond control boundaries. Class diagram for updated label usage in PageDetails.qmlclassDiagram
class Label {
}
class DccLabel {
+Layout.alignment: Qt.AlignLeft
+Layout.fillWidth: true
+font: DccUtils.copyFont(...)
+text: dccObj.displayName
+elide: Text.ElideMiddle
}
PageDetails ..> DccLabel : uses
Label <|-- DccLabel
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> `dcc-network/qml/PageDetails.qml:45` </location>
<code_context>
- Label {
+ DccLabel {
Layout.alignment: Qt.AlignLeft
+ Layout.fillWidth: true
font: DccUtils.copyFont(D.DTK.fontManager.t4, {
"bold": true
</code_context>
<issue_to_address>
**suggestion:** Setting Layout.fillWidth to true may affect layout responsiveness.
Please verify that expanding the label does not disrupt alignment or spacing of other RowLayout elements, particularly with dynamic content or resizing.
Suggested implementation:
```
DccLabel {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
// Debug: Add border to verify label expansion and layout impact
border.color: "red"
border.width: 1
font: DccUtils.copyFont(D.DTK.fontManager.t4, {
"bold": true
})
text: dccObj.displayName
elide: Text.ElideMiddle
// TODO: Remove border after verifying layout responsiveness
// If expansion disrupts layout, consider constraining width:
// Layout.preferredWidth: 200
// Layout.maximumWidth: 300
}
```
After running the application and resizing the window, observe the red border around the label. If the label's expansion disrupts the alignment or spacing of other elements, uncomment and adjust `Layout.preferredWidth` or `Layout.maximumWidth` as needed. Remove the border once verification is complete.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: caixr23, mhduiy 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 |
Modifying text beyond the scope of the control pms: BUG-317343
deepin pr auto review我来帮你分析这段代码的变更。这段修改主要涉及QML界面中标签组件的改进,让我从多个角度进行分析:
改进建议:
Layout.maximumWidth: parent.width * 0.8
text: dccObj.displayName.toString().escape()
ToolTip.text: dccObj.displayName
ToolTip.visible: truncated总体来说,这是一个良好的改进,提升了界面的可用性和美观性。修改合理,没有明显问题。 |
Modifying text beyond the scope of the control
pms: BUG-317343
Summary by Sourcery
Prevent text overflow in PageDetails by using DccLabel with fillWidth and middle ellipsis for the displayName
Enhancements: