-
Notifications
You must be signed in to change notification settings - Fork 42
fix: GroupBox label background is always white #523
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#523
Reviewer's GuideThis PR fixes the GroupBox label background color by assigning the theme’s window color to its background rectangle and adds a new QML Inspect example for GroupBox to verify the change. Class diagram for updated GroupBox QML componentclassDiagram
class GroupBox {
+title: string
background: Rectangle
}
class Rectangle {
+color: control.palette.window
}
GroupBox "1" *-- "1" Rectangle: background
Class diagram for new Example_GroupBox QML componentclassDiagram
class Example_GroupBox {
Flow
Row
GroupBox
ColumnLayout
CheckBox
Label
}
Example_GroupBox "1" *-- "1" Flow
Flow "1" *-- "1" Row
Row "1" *-- "2" GroupBox
GroupBox "1" *-- "1" ColumnLayout
ColumnLayout "1" *-- "3" CheckBox
GroupBox "1" *-- "1" Label
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.
修正 GroupBox 标签文本的背景颜色总是白色的问题,会导致在暗色主题下 文字无法被看清楚. 注:只改了 qt 6 的版本. Log:
b8f1e82 to
02d2aad
Compare
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#523
deepin pr auto review代码审查意见Example_GroupBox.qml语法逻辑
代码质量
代码性能
代码安全
改进建议// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.0
import QtQuick.Layouts 1.11
import org.deepin.dtk 1.0
// GroupBox示例,展示GroupBox的基本用法和布局
Flow {
id: control
spacing: 20
width: parent.width // 添加宽度属性
Row {
spacing: 20
width: parent.width
GroupBox {
title: "GroupBox"
width: 200 // 添加固定宽度
ColumnLayout {
anchors.fill: parent
anchors.margins: 5 // 添加边距
CheckBox { text: "E-mail" }
CheckBox { text: "Super Fancy Calendar" }
CheckBox { text: "Contacts" }
}
}
GroupBox {
title: "GroupBox 2"
width: 200 // 添加固定宽度
ColumnLayout {
anchors.fill: parent
anchors.margins: 5 // 添加边距
Label {
text: "GroupBox Content"
Layout.alignment: Qt.AlignCenter // 添加对齐方式
}
}
}
}
}main.qml语法逻辑
代码质量
代码性能
代码安全
改进建议V2.TabButton {
text: qsTr("GroupBox") // 添加注释说明这是GroupBox示例
// 用于展示GroupBox控件的基本用法和布局
}qml.qrc语法逻辑
代码质量
代码性能
代码安全
改进建议无特别建议,当前配置已经很好。 qt6/src/qml/GroupBox.qml语法逻辑
代码质量
代码性能
代码安全
改进建议无特别建议,当前实现已经很好。 总结
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia 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#523
修正 GroupBox 标签文本的背景颜色总是白色的问题,会导致在暗色主题下文字无法被看清楚.
注:
采取了给 Rectangle 加颜色而不是移除 Rectangle 的形式,以免哪天需要给 GroupBox 加 border。最终决定还是以删除现有 Rectangle 的形式。当前修改的实际效果(参考命令
LD_LIBRARY_PATH=/home/blumia/Sources/dtkdeclarative/build/qt6/src ./build/examples/qml-inspect/qml-inspect):给
background加了border.color: control.palette.windowText的效果(此 PR 并未添加,只是作为参考):Summary by Sourcery
Fix theming issue where the GroupBox header background was always white and add a new GroupBox example to the qml-inspect tool for demonstration purposes
New Features:
Bug Fixes:
Enhancements: