fix: remove redundant palette setup in RoundScrollArea#351
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoved redundant palette configuration and directly used Qt::transparent in paintEvent to simplify background drawing in RoundScrollArea. Class diagram for updated RoundScrollArea transparency handlingclassDiagram
class RoundScrollArea {
- int m_radius
+ RoundScrollArea(QWidget *parent)
+ setRadius(int radius)
+ paintEvent(QPaintEvent *e)
}
QScrollArea <|-- RoundScrollArea
%% Note: Palette setup removed from constructor; paintEvent now uses Qt::transparent directly
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
18202781743
previously approved these changes
Aug 15, 2025
18202781743
reviewed
Aug 15, 2025
| path.addRoundedRect(viewport()->rect(), m_radius, m_radius); | ||
| painter.setClipPath(path); | ||
| painter.fillPath(path, palette().window()); | ||
| painter.fillPath(path, Qt::transparent); |
1. Removed unnecessary palette initialization in constructor that was setting window brush to transparent 2. Changed paintEvent to directly use Qt::transparent instead of palette().window() 3. This simplifies the code while maintaining the same visual effect of transparency 4. The palette setup was redundant since we're manually painting the background anyway fix: 移除RoundScrollArea,使用QScrollArea. 1. 移除RoundScrollArea 2. 修改paintEvent直接使用Qt::transparent替代palette().window() 3. 在保持相同透明视觉效果的同时简化了代码 4. 调色板设置是多余的,因为我们已经手动绘制背景 Pms: bug-315535
e0f6910 to
5c11855
Compare
deepin pr auto review根据提供的git diff,我来进行代码审查,并提出改进意见: 1. 代码逻辑分析这次修改主要是将自定义的
2. 语法逻辑评估语法上没有问题,代码可以正常编译和运行。但是需要注意:
3. 代码质量改进
4. 性能评估
5. 安全性评估
改进建议
总体而言,这次修改简化了代码实现,提高了维护性,但需要注意UI一致性和潜在依赖问题。建议在全面测试后再合并此修改。 |
18202781743
approved these changes
Aug 18, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich 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 |
Contributor
Author
|
/forcemerge |
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.
fix: 移除RoundScrollArea中多余的调色板设置
Pms: bug-315535
Summary by Sourcery
Simplify RoundScrollArea by removing redundant palette setup and directly using Qt::transparent in paintEvent for background transparency
Enhancements: