sync: from linuxdeepin/dtkdeclarative#295
Merged
Merged
Conversation
Contributor
Author
deepin pr auto review我对这段代码进行审查,提供以下改进意见:
// 建议的改进版本
import QtQuick 2.0
import QtQuick.Layouts 1.11
import org.deepin.dtk 1.0
ColumnLayout {
id: control
spacing: 10 // 定义统一的间距
// 定义可复用的GroupBox组件
GroupBox {
Layout.fillWidth: true
title: "GroupBox"
ColumnLayout {
anchors.fill: parent
spacing: 5
CheckBox { text: qsTr("E-mail") }
CheckBox { text: qsTr("Super Fancy Calendar") }
CheckBox { text: qsTr("Contacts") }
}
}
GroupBox {
Layout.fillWidth: true
title: "GroupBox 2"
ColumnLayout {
anchors.fill: parent
spacing: 5
Label {
text: qsTr("GroupBox Content")
wrapMode: Text.WordWrap
}
}
}
}
这些改进将使代码更加健壮、可维护,并提供更好的用户体验。 |
Reviewer's GuideThis PR syncs GroupBox support from linuxdeepin/dtkdeclarative by patching the background color handling in the GroupBox component and adding a new QML example (with UI entry) to demonstrate its usage in the qml-inspect tool. Class diagram for updated GroupBox QML componentclassDiagram
class GroupBox {
+title: string
+background: Rectangle
}
class Rectangle {
+color: palette.window
}
GroupBox "1" *-- "1" Rectangle: background
Class diagram for new Example_GroupBox QML exampleclassDiagram
class Example_GroupBox {
+Row
+GroupBox
}
class GroupBox {
+title: string
+content: ColumnLayout or Label
}
class ColumnLayout {
+CheckBox: ["E-mail", "Super Fancy Calendar", "Contacts"]
}
class Label {
+text: "GroupBox Content"
}
Example_GroupBox "1" *-- "1" Row
Row "1" *-- "2" GroupBox
GroupBox "1" *-- "1" ColumnLayout
GroupBox "1" *-- "1" Label
ColumnLayout "1" *-- "3" CheckBox
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#523
e43e57c to
488e365
Compare
BLumia
approved these changes
Sep 1, 2025
Contributor
Author
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, 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 |
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#523
Summary by Sourcery
Synchronize the GroupBox component from upstream, enforce its background color using the theme palette, and add a corresponding example in the qml-inspect tool.
New Features:
Enhancements: