-
Notifications
You must be signed in to change notification settings - Fork 60
style: replace shadows with borders in OSD notifications #1442
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
1. Replaced D.BoxShadow and D.BoxInsetShadow components with D.InsideBoxBorder and D.OutsideBoxBorder in display mode and window effect panels 2. Added new color palette properties for inside and outside borders with checked and normal states 3. Adjusted background color darkness in dark mode from 0.6 to 0.5 for better contrast 4. Added D.OutsideBoxBorder component to main OSD window 5. Removed obsolete dropShadowColor and innerShadowColor palette properties This change transitions from shadow-based visual effects to border-based effects for clearer definition of UI elements while maintaining visual hierarchy. Border effects provide better visibility across different themes and improve rendering performance. Log: Updated OSD notification visual style with borders replacing shadows for better clarity and theme consistency Influence: 1. Test OSD notifications in both light and dark modes to verify border visibility 2. Verify selected and unselected states show proper border colors 3. Check display mode switching and ensure visual consistency 4. Test window effects and notification popups for proper border rendering 5. Verify that the changes don't affect touch interactions or responsiveness 6. Confirm that the visual hierarchy remains clear with the new border effects PMS: BUG-311255
Reviewer's GuideThis PR updates the OSD notification display mode and window effect panels to replace shadow-based styling with border-based components, introduces new border color palettes (including checked/normal and light/dark variants), slightly lightens the checked background in dark mode, and removes obsolete shadow-related palette properties. Class diagram for updated OSD notification styling components and palettesclassDiagram
class AppletItem {
}
class ColorSelectorPalettes {
+D.Palette backgroundColor
+D.Palette checkedBackgroundColor
+D.Palette insideBorderColor
+D.Palette checkedInsideBorderColor
+D.Palette outsideBorderColor
+D.Palette checkedOutsideBorderColor
-D.Palette dropShadowColor
-D.Palette innerShadowColor
}
class DPalette {
+color normal
+color normalDark
}
class InsideBoxBorder {
+DPalette color
+int radius
+anchors anchors
}
class OutsideBoxBorder {
+DPalette color
+int radius
+anchors anchors
}
class BoxShadow {
+color shadowColor
+int shadowOffsetX
+int shadowOffsetY
+int shadowBlur
+int cornerRadius
+int spread
+bool hollow
}
class BoxInsetShadow {
+color shadowColor
+int shadowOffsetX
+int shadowOffsetY
+int shadowBlur
+int cornerRadius
+int spread
}
AppletItem --> ColorSelectorPalettes
AppletItem --> InsideBoxBorder
AppletItem --> OutsideBoxBorder
ColorSelectorPalettes o-- DPalette
InsideBoxBorder o-- DPalette
OutsideBoxBorder o-- DPalette
%% Previously used shadow components no longer referenced in updated OSD panels
AppletItem ..> BoxShadow
AppletItem ..> BoxInsetShadow
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这段代码diff展示了两个QML文件( 以下是对这段代码的审查意见,分为语法逻辑、代码质量、代码性能和代码安全四个方面: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进建议
总结: |
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 2 issues, and left some high level feedback:
- The new
insideBorderColor/checkedInsideBorderColorandoutsideBorderColor/checkedOutsideBorderColorpalettes are defined as properties on theD.InsideBoxBorder/D.OutsideBoxBorderinstances, but thecolorbindings referenceD.ColorSelector.*instead of the local properties, which will resolve to undefined unless you also add these palettes toColorSelectoror change the bindings to use the local properties. - The border palette definitions and border component setups are duplicated between
displaymodeandwindoweffect; consider extracting the common border configuration into a shared component or central palette to keep the visual style consistent and easier to adjust later.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `insideBorderColor`/`checkedInsideBorderColor` and `outsideBorderColor`/`checkedOutsideBorderColor` palettes are defined as properties on the `D.InsideBoxBorder`/`D.OutsideBoxBorder` instances, but the `color` bindings reference `D.ColorSelector.*` instead of the local properties, which will resolve to undefined unless you also add these palettes to `ColorSelector` or change the bindings to use the local properties.
- The border palette definitions and border component setups are duplicated between `displaymode` and `windoweffect`; consider extracting the common border configuration into a shared component or central palette to keep the visual style consistent and easier to adjust later.
## Individual Comments
### Comment 1
<location> `panels/notification/osd/displaymode/package/main.qml:132-141` </location>
<code_context>
+ color: itemView.isCurrent ? D.ColorSelector.checkedInsideBorderColor
</code_context>
<issue_to_address>
**issue (bug_risk):** The color bindings likely need to reference the item-specific ColorSelector (itemView.D.ColorSelector) rather than the global D.ColorSelector.
Elsewhere in this file, ColorSelector is accessed as `itemView.D.ColorSelector.*`, implying it’s scoped to `itemView`. Using `D.ColorSelector.*` here may either not resolve or use a different/global instance. Please update these bindings to `itemView.D.ColorSelector.checkedInsideBorderColor` / `itemView.D.ColorSelector.insideBorderColor` (and the outside border equivalents) to match the background color binding and ensure consistent behavior.
</issue_to_address>
### Comment 2
<location> `panels/notification/osd/windoweffect/package/main.qml:181-190` </location>
<code_context>
+ color: itemView.isCurrent ? D.ColorSelector.checkedInsideBorderColor
</code_context>
<issue_to_address>
**issue (bug_risk):** Color bindings should probably reference the attached ColorSelector on itemView, not a global D.ColorSelector.
The existing background color bindings use `itemView.D.ColorSelector.*`, implying the ColorSelector is attached to `itemView`. These new bindings switch to `D.ColorSelector.*`, which may reference a different (or no) palette and could cause theming issues or runtime failures. Please update these to `itemView.D.ColorSelector.checkedInsideBorderColor` / `itemView.D.ColorSelector.insideBorderColor` (and the outside variants) to stay consistent with the current pattern.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| color: itemView.isCurrent ? D.ColorSelector.checkedInsideBorderColor | ||
| : D.ColorSelector.insideBorderColor | ||
| } | ||
| D.BoxInsetShadow { | ||
| visible: !itemView.isCurrent | ||
| D.OutsideBoxBorder { | ||
| property D.Palette outsideBorderColor: D.Palette { | ||
| normal: Qt.rgba(0, 0, 0, 0.05) | ||
| normalDark: Qt.rgba(0, 0, 0, 0.4) | ||
| } | ||
| property D.Palette checkedOutsideBorderColor: D.Palette { | ||
| normal: Qt.rgba(0, 0, 0, 0.1) |
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.
issue (bug_risk): The color bindings likely need to reference the item-specific ColorSelector (itemView.D.ColorSelector) rather than the global D.ColorSelector.
Elsewhere in this file, ColorSelector is accessed as itemView.D.ColorSelector.*, implying it’s scoped to itemView. Using D.ColorSelector.* here may either not resolve or use a different/global instance. Please update these bindings to itemView.D.ColorSelector.checkedInsideBorderColor / itemView.D.ColorSelector.insideBorderColor (and the outside border equivalents) to match the background color binding and ensure consistent behavior.
| color: itemView.isCurrent ? D.ColorSelector.checkedInsideBorderColor | ||
| : D.ColorSelector.insideBorderColor | ||
| } | ||
| D.BoxInsetShadow { | ||
| visible: !itemView.isCurrent | ||
| D.OutsideBoxBorder { | ||
| property D.Palette outsideBorderColor: D.Palette { | ||
| normal: Qt.rgba(0, 0, 0, 0.05) | ||
| normalDark: Qt.rgba(0, 0, 0, 0.4) | ||
| } | ||
| property D.Palette checkedOutsideBorderColor: D.Palette { | ||
| normal: Qt.rgba(0, 0, 0, 0.1) |
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.
issue (bug_risk): Color bindings should probably reference the attached ColorSelector on itemView, not a global D.ColorSelector.
The existing background color bindings use itemView.D.ColorSelector.*, implying the ColorSelector is attached to itemView. These new bindings switch to D.ColorSelector.*, which may reference a different (or no) palette and could cause theming issues or runtime failures. Please update these to itemView.D.ColorSelector.checkedInsideBorderColor / itemView.D.ColorSelector.insideBorderColor (and the outside variants) to stay consistent with the current pattern.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, qxp930712 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 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
This change transitions from shadow-based visual effects to border-based effects for clearer definition of UI elements while maintaining visual hierarchy. Border effects provide better visibility across different themes and improve rendering performance.
Log: Updated OSD notification visual style with borders replacing shadows for better clarity and theme consistency
Influence:
PMS: BUG-311255
Summary by Sourcery
Update OSD notification UI to use border-based styling instead of shadow effects for clearer, more consistent visuals across themes.
Enhancements: