-
Notifications
You must be signed in to change notification settings - Fork 21
sync: from linuxdeepin/dtkdeclarative #315
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
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#542
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpstream sync: Introduced leftPadding/rightPadding properties in DialogWindow.qml to centralize horizontal content margins and refactored Layout margins to use these new properties instead of direct DS.Style references. Class diagram for updated DialogWindow.qml propertiesclassDiagram
class DialogWindow {
string icon
alias content
alias palette
real leftPadding
real rightPadding
}
DialogWindow : leftPadding = DS.Style.dialogWindow.contentHMargin
DialogWindow : rightPadding = DS.Style.dialogWindow.contentHMargin
DialogWindow --> Item : content
Item --> Loader : contentLoader
Loader : Layout.leftMargin = control.leftPadding
Loader : Layout.rightMargin = control.rightPadding
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
deepin pr auto review我来对这段 QML 代码的修改进行审查:
建议:
示例改进代码: Window {
// ... 其他属性 ...
// 添加统一的 padding 属性
property real padding: 0
property real leftPadding: padding || DS.Style.dialogWindow.contentHMargin
property real rightPadding: padding || DS.Style.dialogWindow.contentHMargin
property real topPadding: padding
property real bottomPadding: padding
// 添加属性验证
onLeftPaddingChanged: if(leftPadding < 0) leftPadding = 0
onRightPaddingChanged: if(rightPadding < 0) rightPadding = 0
onTopPaddingChanged: if(topPadding < 0) topPadding = 0
onBottomPaddingChanged: if(bottomPadding < 0) bottomPadding = 0
// ... 其他代码 ...
}总的来说,这个修改是一个很好的改进,提高了代码的灵活性和可维护性。通过添加内边距属性,使得对话框的内容区域布局更加可控。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot, 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#542
Summary by Sourcery
Introduce horizontal padding properties in DialogWindow.qml and refactor its content loader to use these properties for margin configuration
Enhancements: