refactor: simplify AlertToolTip implementation using FloatingPanel#504
Conversation
1. Replaced custom background implementation in AlertToolTip with FloatingPanel component 2. Removed redundant BoxShadow and connector elements as FloatingPanel handles these 3. Updated FlowStyle with new palette properties for borders and shadows 4. Modified FloatingPanel to always show inside border when color is specified 5. Adjusted alertToolTip background opacity values for better visibility The changes simplify the codebase by reusing existing FloatingPanel component instead of maintaining duplicate shadow and border logic. This makes the styling more consistent and easier to maintain. The opacity adjustments improve visual appearance across different themes. refactor: 使用 FloatingPanel 简化 AlertToolTip 实现 1. 使用 FloatingPanel 组件替换 AlertToolTip 中的自定义背景实现 2. 移除了冗余的 BoxShadow 和连接器元素,由 FloatingPanel 统一处理 3. 更新 FlowStyle 添加新的边框和阴影调色板属性 4. 修改 FloatingPanel 在指定颜色时始终显示内部边框 5. 调整 alertToolTip 背景透明度值以获得更好的可视性 这些变更通过重用现有的 FloatingPanel 组件简化了代码库,而不是维护重复的 阴影和边框逻辑。这使得样式更加一致且易于维护。透明度调整改善了不同主题下 的视觉效果。 pms: BUG-293293
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#504
deepin pr auto review代码审查意见:
总体来说,代码重构和性能优化是主要改进点。建议在合并代码前,进行充分的测试,确保重构后的代码功能正常,并且没有引入新的问题。 |
Reviewer's GuideThis PR refactors AlertToolTip to reuse the FloatingPanel component for its background and shadow logic, updates FlowStyle with dedicated palette entries for borders and shadows (and adjusts alertToolTip opacity), and ensures FloatingPanel always displays its inside border when a color is provided. Class diagram for AlertToolTip refactor using FloatingPanelclassDiagram
class AlertToolTip {
- background: FloatingPanel
- contentItem: Text
}
class FloatingPanel {
+ backgroundColor
+ insideBorderColor
+ outsideBorderColor
}
AlertToolTip --> FloatingPanel : uses
Class diagram for updated FlowStyle palette propertiesclassDiagram
class FlowStyle {
+ alertToolTip.background : D.Palette
+ alertToolTip.insideBorder : D.Palette
+ alertToolTip.outsideBorder : D.Palette
+ alertToolTip.dropShadow : D.Palette
}
class D.Palette {
+ normal
+ normalDark
}
FlowStyle --> D.Palette : uses
Class diagram for FloatingPanel inside border logic updateclassDiagram
class FloatingPanel {
+ insideBorderColor
+ showInsideBorder()
}
FloatingPanel : showInsideBorder() always active if insideBorderColor is set
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @18202781743 - I've reviewed your changes and they look great!
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: 18202781743, 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 |
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#504
FloatingPanel component
handles these
specified
The changes simplify the codebase by reusing existing FloatingPanel
component instead of maintaining duplicate shadow and border logic. This
makes the styling more consistent and easier to maintain. The opacity
adjustments improve visual appearance across different themes.
refactor: 使用 FloatingPanel 简化 AlertToolTip 实现
这些变更通过重用现有的 FloatingPanel 组件简化了代码库,而不是维护重复的
阴影和边框逻辑。这使得样式更加一致且易于维护。透明度调整改善了不同主题下
的视觉效果。
pms: BUG-293293
Summary by Sourcery
Simplify AlertToolTip styling by reusing the FloatingPanel component for backgrounds and borders, consolidate shadow and connector logic, introduce new palette properties in FlowStyle, enforce inside border rendering in FloatingPanel, and fine-tune background opacities for improved visibility.
Enhancements: