From 212f6765c40bdc07e70343f10dac09c0afea9e29 Mon Sep 17 00:00:00 2001 From: zhangkun2 Date: Wed, 19 Aug 2026 17:47:57 +0800 Subject: [PATCH] fix(dcc): 48px description rows and min height MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The editor row height/gap spec (description rows 48px, gap 6px) is a common design rule, not an eye-comfort-only tweak. Move it to the framework so every non-group Editor/MenuEditor row with a description gets 0/0 insets (48px content) instead of the delegate's default 3/3 (54px), matching group-internal description rows. Group-external rows without a description keep 3/3, so the existing d0b4e8539 spacing for single-line switches is preserved. Affected rows: eyeComfort, grubTheme, regions, regionAndFormat (all 54->48px). Group-internal description rows (15) and group-external no-description rows are unchanged. Also restore Layout.minimumHeight on DccEditorItem. The implicitHeight Math.max(48,40,...) floor is dead code: DccEditorItem inherits QQuickControl, which recomputes implicitHeight from content and overrides the QML binding, so the 40/48 floor never took effect and colorTemperature (no description, content ~38) rendered 38px. Layout .minimumHeight is enforced by the parent ColumnLayout and not overridden by QQuickControl, so no-description rows are at least 40px and description rows at least 48px. Only raises rows below the floor, never lowers them. Influence: 1. Verify eye-comfort switch row height is 48px and gap to group is 6px 2. Verify grubTheme / regions / regionAndFormat rows are 48px 3. Verify color-temperature row height is 40px 4. Regression: group-internal description rows and no-description rows unchanged fix(dcc): 框架级 48px 行高与编辑项最小高度 带 description 的编辑项 48px 行高 + 6px 间距是通用设计规范,不应靠 eyeComfort 单点覆盖。将修复提到框架层:组外带 description 的 Editor/MenuEditor 项委托 inset 由 3/3 改为 0/0(48px 内容行),与组内 带 description 项对齐;组外无 description 项维持 3/3,保留 d0b4e8539 对单行开关的间距意图。受影响项:eyeComfort、grubTheme、regions、 regionAndFormat(均 54→48px)。组内带 description 项(15 个)与组外 无 description 项不变。 同时在 DccEditorItem 补回 Layout.minimumHeight。implicitHeight 的 Math.max(48,40,...) 下限是死代码:DccEditorItem 继承 QQuickControl, Control 按内容重算 implicitHeight 并覆盖 QML 绑定,故下限从未生效、 colorTemperature(无描述、内容约 38)渲染 38px。Layout.minimumHeight 由父级 ColumnLayout 强制执行、不被 QQuickControl 覆盖,使无描述项 至少 40px、有描述项至少 48px。只抬高低于下限的行,不压低任何行。 Influence: 1. 验证护眼模式开关项行高 48px、与下方组间距 6px 2. 验证 grubTheme / regions / regionAndFormat 行高为 48px 3. 验证色温调节项行高为 40px 4. 回归:组内带 description 项与组外无 description 项无变化 PMS: bug-308813 --- src/dde-control-center/plugin/DccEditorItem.qml | 1 + src/dde-control-center/plugin/DccGroupView.qml | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dde-control-center/plugin/DccEditorItem.qml b/src/dde-control-center/plugin/DccEditorItem.qml index 9be91bae75..e3e9469d7f 100644 --- a/src/dde-control-center/plugin/DccEditorItem.qml +++ b/src/dde-control-center/plugin/DccEditorItem.qml @@ -19,6 +19,7 @@ D.ItemDelegate { property real rightItemBottomMargin: 5 implicitHeight: Math.max(model.item.description.length !== 0 ? 48 : 40, implicitContentHeight) + topInset + bottomInset + Layout.minimumHeight: (model.item.description.length !== 0 ? 48 : 40) + topInset + bottomInset backgroundVisible: false checkable: false topPadding: topInset diff --git a/src/dde-control-center/plugin/DccGroupView.qml b/src/dde-control-center/plugin/DccGroupView.qml index a72ae36dd3..4d74cba016 100644 --- a/src/dde-control-center/plugin/DccGroupView.qml +++ b/src/dde-control-center/plugin/DccGroupView.qml @@ -90,8 +90,8 @@ Rectangle { DelegateChoice { roleValue: DccObject.Editor delegate: DccEditorItem { - topInset: control.isGroup ? 0 : 3 - bottomInset: control.isGroup ? 0 : 3 + topInset: (control.isGroup || model.item.description.length !== 0) ? 0 : 3 + bottomInset: (control.isGroup || model.item.description.length !== 0) ? 0 : 3 separatorVisible: control.isGroup backgroundType:model.item.backgroundType | (control.isGroup ? 1 : 0) Layout.fillWidth: true @@ -114,8 +114,8 @@ Rectangle { DelegateChoice { roleValue: DccObject.MenuEditor delegate: DccMenuEditorItem { - topInset: control.isGroup ? 0 : 3 - bottomInset: control.isGroup ? 0 : 3 + topInset: (control.isGroup || model.item.description.length !== 0) ? 0 : 3 + bottomInset: (control.isGroup || model.item.description.length !== 0) ? 0 : 3 separatorVisible: control.isGroup backgroundType: model.item.backgroundType | DccObject.ClickStyle Layout.fillWidth: true