-
Notifications
You must be signed in to change notification settings - Fork 37
fix: app name text might overlap if it's a newly installed app #690
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
Text.RichText doesn't support the elide property, for our case, using Text.StyledText could be enough. PMS: BUG-325737 Log:
Reviewer's guide (collapsed on small PRs)Reviewer's GuideSwitches the app name label for newly installed apps from using rich text formatting to styled text to support text eliding and avoid overlap, while keeping plain text for other cases unchanged. Flow diagram for selecting textFormat based on newly installed statusflowchart TD
A[IconItemDelegate evaluates model] --> B{Is app newly installed?}
B -->|Yes, lastLaunchedTime == 0 and installedTime != 0| C[Set isNewlyInstalled to true]
B -->|No| D[Set isNewlyInstalled to false]
C --> E[Set text to badge_dot_plus_root_text]
D --> F[Set text to root_text]
C --> G[Set textFormat to Text.StyledText]
D --> H[Set textFormat to Text.PlainText]
G --> I[Label supports eliding and avoids overlap]
H --> I
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 - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `qml/IconItemDelegate.qml:195` </location>
<code_context>
id: iconItemLabel
text: isNewlyInstalled ? ("<font color='#669DFF' size='1' style='text-shadow: 0 0 1px rgba(255,255,255,0.1)'>●</font> " + root.text) : root.text
- textFormat: isNewlyInstalled ? Text.RichText : Text.PlainText
+ textFormat: isNewlyInstalled ? Text.StyledText : Text.PlainText
width: parent.width
leftPadding: 2
</code_context>
<issue_to_address>
**suggestion:** Review whether the inline CSS in `text` is still meaningful with `Text.StyledText`.
`Text.StyledText` only supports a subset of HTML/CSS, so the `style='text-shadow: ...'` on the colored dot will likely be ignored. If the shadow isn’t needed, consider removing that unsupported style (or moving the visual effect to a separate QML item) to avoid implying that a text shadow is applied when it isn’t.
```suggestion
text: isNewlyInstalled ? ("<font color='#669DFF' size='1'>●</font> " + root.text) : root.text
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review这段代码修改将 QML 文本组件的 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与建议总体评价:这是一个非常合理且优秀的修改。 建议:
最终结论:接受该修改。它在保持功能不变的前提下,提升了性能和安全性。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia 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 |
Text.RichText doesn't support the elide property, for our case, using Text.StyledText could be enough.
Summary by Sourcery
Bug Fixes: