Repository navigation
fix: Modifying text beyond the scope of the control - #430
Merged
Merged
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.
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.
mhduiy
approved these changes
Nov 6, 2025
|
[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总体来说,这是一个良好的改进,提升了界面的可用性和美观性。修改合理,没有明显问题。 |
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
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.
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: