sync: from linuxdeepin/dtkdeclarative#307
Merged
Merged
Conversation
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#534
Contributor
Author
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot 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 GuideThis PR syncs QML sources from upstream, enhancing the AlertToolTip by adding a shadowed connector and updating color palettes in FlowStyle to improve border and background visibility. Entity relationship diagram for updated palette properties in FlowStyle.qmlerDiagram
FLOWSTYLE {
real focusBorderPaddings
D.Palette border
D.Palette connecterBackground
D.Palette dropShadow
}
D.PALETTE {
normal
normalDark
}
FLOWSTYLE ||--o| D.PALETTE : border
FLOWSTYLE ||--o| D.PALETTE : connecterBackground
FLOWSTYLE ||--o| D.PALETTE : dropShadow
Class diagram for updated AlertToolTip.qml structureclassDiagram
class ToolTip {
}
class BoxShadow {
+D.Palette dropShadowColor
+D.Palette backgroundColor
+D.Palette borderColor
+y
+width
+height
+shadowBlur
+shadowOffsetY
+shadowColor
+cornerRadius
}
class Rectangle {
+color
+border.color
+border.width
}
ToolTip <|-- BoxShadow
BoxShadow <|-- Rectangle
Class diagram for updated FlowStyle.qml palette propertiesclassDiagram
class FlowStyle {
+D.Palette border
+D.Palette connecterBackground
+D.Palette dropShadow
}
class D.Palette {
+normal
+normalDark
}
FlowStyle --> D.Palette
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
Author
deepin pr auto review根据提供的代码差异,我来对这段代码进行审查,并提出改进建议:
具体改进建议:
// 修改前
normal: Qt.rgba(0, 0, 0, 0.05)
normalDark: Qt.rgba(0, 0, 0, 0.05)
// 建议修改为
readonly property real defaultBorderOpacity: 0.05
normal: Qt.rgba(0, 0, 0, defaultBorderOpacity)
normalDark: Qt.rgba(0, 0, 0, defaultBorderOpacity)
// 修改前
normalDark: Qt.rgba(51 / 255.0, 51 / 255.0, 51 / 255.0, 1)
// 建议修改为
readonly property real darkGrayValue: 51 / 255.0
normalDark: Qt.rgba(darkGrayValue, darkGrayValue, darkGrayValue, 1)
// 建议添加性能优化
BoxShadow {
id: line
// ... 其他属性保持不变
// 添加缓存属性
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
width: line.width
height: line.height
radius: line.cornerRadius
}
}
}
// 在DS.Style中添加
property real minConnectorWidth: 2
property real maxConnectorWidth: 20
// 在使用时添加验证
width: Math.max(Math.min(DS.Style.alertToolTip.connectorWidth, maxConnectorWidth), minConnectorWidth)
property D.Palette dropShadowColor: DS.Style.isDarkMode ?
DS.Style.alertToolTip.connecterdropShadowDark :
DS.Style.alertToolTip.connecterdropShadowLight这些建议旨在提高代码的可维护性、性能和安全性,同时保持代码的清晰和可读性。 |
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.
Synchronize source files from linuxdeepin/dtkdeclarative.
Source-pull-request: linuxdeepin/dtkdeclarative#534
Summary by Sourcery
Sync source files from linuxdeepin/dtkdeclarative, introducing a connector arrow shadow in alert tooltips and refining style palette values.
New Features:
Enhancements: