fix(notification): improve action button background styling#1455
Open
add-uos wants to merge 1 commit intolinuxdeepin:masterfrom
Open
fix(notification): improve action button background styling#1455add-uos wants to merge 1 commit intolinuxdeepin:masterfrom
add-uos wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
deepin pr auto review这段代码的 diff 展示了对 1. 语法逻辑审查
2. 代码质量审查
3. 代码性能审查
4. 代码安全审查
5. 具体属性审查
总结与改进后的代码示例主要改进点:消除重复代码,提取公共样式。 // 假设在文件顶部或合适位置定义通用属性
property Palette commonSemiTransparentBg: Palette {
normal { common: Qt.rgba(0, 0, 0, 0.15) }
normalDark { common: Qt.rgba(0, 0, 0, 0.2) }
}
// ... 在控件中使用 ...
Background {
radius: 6
outsideBorderColor: null
insideBorderColor: null
dropShadowColor: null
backgroundColor: commonSemiTransparentBg // 引用定义好的属性
anchors.fill: parent
// ...
}
// ... 另一处控件中同样引用 ...
Background {
radius: 6
outsideBorderColor: null
insideBorderColor: null
dropShadowColor: null
backgroundColor: commonSemiTransparentBg // 引用定义好的属性
anchors.fill: parent
}这样修改后,代码更加简洁、易维护,且性能略有提升。 |
improve action button background styling log: improve action button background styling bug: PMS-350965
mhduiy
approved these changes
Feb 26, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefines notification action button visuals by introducing a shared palette-based background color and applying it consistently to button frames while disabling their drop shadows. Class diagram for updated NotifyAction QML stylingclassDiagram
class NotifyAction {
+signal gotoNextItem()
+signal gotoNextButton()
+signal gotoPrevItem()
+Palette actionBackgroundColor
+function focusFirstButton()
}
class Palette {
+color normal_common
+color normalDark_common
}
class Frame {
+int radius
+color outsideBorderColor
+color insideBorderColor
+color dropShadowColor
+Palette backgroundColor
}
NotifyAction *-- Palette : actionBackgroundColor
NotifyAction *-- Frame : actionButtonFrame1
NotifyAction *-- Frame : actionButtonFrame2
Palette <|-- ActionBackgroundPalette
class ActionBackgroundPalette {
+color normal_common = Qt.rgba(0,0,0,0.15)
+color normalDark_common = Qt.rgba(0,0,0,0.2)
}
Frame <|-- ActionButtonFrame
class ActionButtonFrame {
+int radius = 6
+color outsideBorderColor = null
+color insideBorderColor = null
+color dropShadowColor = null
+Palette backgroundColor = NotifyAction.actionBackgroundColor
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider renaming
actionBackgroundColorto something likeactionBackgroundPaletteto better reflect that the property is aPaletteobject rather than a single color value. - If
actionBackgroundColoris not intended to be modified externally at runtime, declare it as areadonly propertyto make the intent clear and prevent accidental mutation.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider renaming `actionBackgroundColor` to something like `actionBackgroundPalette` to better reflect that the property is a `Palette` object rather than a single color value.
- If `actionBackgroundColor` is not intended to be modified externally at runtime, declare it as a `readonly property` to make the intent clear and prevent accidental mutation.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
improve action button background styling
log: improve action button background styling
bug: PMS-350965
Summary by Sourcery
Improve visual styling of notification action button backgrounds to use a consistent themed background color without drop shadows.
Bug Fixes:
Enhancements: