-
Notifications
You must be signed in to change notification settings - Fork 55
fix: Fix the issue of incomplete display of long text #1342
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
base: master
Are you sure you want to change the base?
Conversation
Fix the issue of incomplete display of long text Log: Fix the issue of incomplete display of long text pms: BUG-338961
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pengfeixx The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR resolves truncated notification text by replacing static height fills with calculated implicitHeight bindings on the content container, ensuring the control resizes based on its children’s actual heights. Class diagram for updated layout components in NotifyItemContent.qmlclassDiagram
class NotifyItem {
}
class Control {
+implicitHeight
}
class contentRow
class contentColumn {
+implicitHeight
}
class firstLine
class title {
+implicitHeight
}
class bodyText {
+implicitHeight
}
class bodyRow
NotifyItem --> Control : contains
Control --> contentRow : contentItem
contentRow --> contentColumn : contains
contentColumn --> firstLine : contains
contentColumn --> title : contains
contentColumn --> bodyText : contains
contentColumn --> bodyRow : contains
contentColumn : -Layout.fillHeight
contentColumn : +implicitHeight
Control : +implicitHeight = contentColumn.implicitHeight
contentColumn : +implicitHeight = sum of children heights
title : +implicitHeight
bodyText : +implicitHeight
Flow diagram for implicitHeight calculation in contentColumnflowchart TD
A["firstLine.Layout.preferredHeight"] --> B["Add to height"]
C["root.title !== ''"] --> D["Add title.implicitHeight to height"]
E["bodyText.visible && bodyText.implicitHeight > 0"] --> F["Add bodyText.implicitHeight to height"]
B --> G["Return total height"]
D --> G
F --> G
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来分析一下这段代码的变更:
implicitHeight: {
var height = firstLine.Layout.preferredHeight
if (root.title !== "") {
height += title.implicitHeight
}
var bodyHeight = bodyText.implicitHeight
if (bodyText.visible && bodyHeight > 0 && bodyText.text !== "") {
height += bodyHeight
}
// 确保高度在合理范围内
return Math.max(NotifyStyle.contentItem.miniHeight,
Math.min(height, 240))
}
总的来说,这是一个积极的改动,使布局更加灵活和精确,但还需要一些细节优化来提高代码的健壮性。 |
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> `panels/notification/plugin/NotifyItemContent.qml:153` </location>
<code_context>
Layout.topMargin: NotifyStyle.contentItem.topMargin
Layout.bottomMargin: NotifyStyle.contentItem.bottomMargin
Layout.fillWidth: true
- Layout.fillHeight: true
Layout.minimumHeight: NotifyStyle.contentItem.miniHeight
Layout.maximumHeight: 240
</code_context>
<issue_to_address>
**question:** Removing Layout.fillHeight may affect vertical stretching of contentColumn.
Please verify that removing Layout.fillHeight does not cause layout issues, especially in scenarios where contentColumn should stretch vertically.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| Layout.topMargin: NotifyStyle.contentItem.topMargin | ||
| Layout.bottomMargin: NotifyStyle.contentItem.bottomMargin | ||
| Layout.fillWidth: true | ||
| Layout.fillHeight: true |
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.
question: Removing Layout.fillHeight may affect vertical stretching of contentColumn.
Please verify that removing Layout.fillHeight does not cause layout issues, especially in scenarios where contentColumn should stretch vertically.
|
这个也处理了高度的问题, #1337 |
|
TAG Bot New tag: 2.0.18 |
|
TAG Bot New tag: 2.0.19 |
Fix the issue of incomplete display of long text
Log: Fix the issue of incomplete display of long text
pms: BUG-338961
Summary by Sourcery
Fix truncated notification text by dynamically calculating and applying implicit heights to the notification content container and its column layout based on child element heights.
Bug Fixes:
Enhancements: