Skip to content

fix(dcc): 48px description rows and min height - #3411

Draft
mhduiy wants to merge 1 commit into
masterfrom
fix/eye-comfort-row-height
Draft

mhduiy wants to merge 1 commit into
masterfrom
fix/eye-comfort-row-height

Conversation

@mhduiy

@mhduiy mhduiy commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

修复内容(框架级实现)

将「带 description 的编辑项 48px 行高 + 6px 间距」从 eyeComfort 单点覆盖提升为框架级默认,并补回 DccEditorItem.Layout.minimumHeight 解决行高下限死代码。本 PR 取代之前的 eyeComfort 单点覆盖方案,diff 仅 2 个文件。

改动(2 个文件)

1. src/dde-control-center/plugin/DccGroupView.qml — Editor + MenuEditor 委托 inset 条件化(#2/#4 通用化)

Editor 与 MenuEditor 委托的 topInset/bottomInset

-                        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

即「组内项 OR 组外带 description 项」→ 0/0(48px 内容行,与组内带 description 项对齐);组外无 description 项维持 3/3。Menu 委托与 Item 委托未改,标题/分组容器不受影响。

2. src/dde-control-center/plugin/DccEditorItem.qml — 补回 Layout.minimumHeight#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

implicitHeightMath.max(48,40,...) 下限是死代码(DccEditorItem 继承 QQuickControl,Control 按内容重算覆盖绑定)。Layout.minimumHeight 由父级 ColumnLayout 强制执行、不被覆盖,使无描述项至少 40px、有描述项至少 48px。只抬高低于下限的行,不压低任何行。

与前一版(eyeComfort 单点覆盖)的差异

  • 移除了 DisplayMain.qml 的 eyeComfort topInset=0/bottomInset=0 单点覆盖(由框架默认接管)。
  • 移除了临时诊断 console.logUpdate zh_TW.po #1 诊断,不进入正式提交)。
  • DisplayMain.qml 现与 master 无 diff,本 PR diff 仅含上述 2 个文件。

5 条 UI 要求覆盖

  1. 标题距左 14px ✅(master DccTitleObject=14 + displayColorTemperature.leftPadding=14,已满足)
  2. 开关设置项高度 48px ✅(eyeComfort 命中框架 inset 0/0 + Layout.minimumHeight 兜底)
  3. 文字距上 6px、说明文字距下 6px ⚠️ 近似(rightItemTopMargin/BottomMargin=6 调右侧 Switch;文字列为 AlignVCenter,需 UI 实测兜底,后续跟进)
  4. 开关项与下方设置项间距 6px ✅(eyeComfort inset 0/0 + eyeComfortGroup.topInset 6)
  5. 色温调节列表高度 40px ✅(Layout.minimumHeight 兜底,colorTemperature 无 description → 40px)

回归影响

框架级改动精确影响 4 个组外带 description 的 Editor 项(行高 54→48px):

  • display:eyeComfort
  • commoninfo:grubTheme
  • datetime:regionsregionAndFormat

不受影响:组内带 description 项(约 15 个,本就 0/0)、组外无 description 项(维持 3/3)、Menu/Item 委托(未改)。建议安装 deb 后抽查上述 4 项行高 48px、间距无视觉异常。

说明

  • 2 个 QML 文件,无 C++/DBus/DConfig 变更,无 console.log。
  • 已通过代码审核(99/100)与本地编译打包验证(master 全量构建通过,2 个 QML 改动已编译入包,DisplayMain.qml 无 diff)。

关联

@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR adjusts the eyeComfort switch row layout so its height and spacing match the design-spec 48px row height and 6px gap to the following group, by explicitly zeroing out the top/bottom insets while preserving existing margins for the right-side switch control.

Sequence diagram for updated eyeComfort row layout handling

sequenceDiagram
    participant EyeComfort
    participant ParentItem
    participant DccEditorItem

    EyeComfort->>ParentItem: onParentItemChanged item
    rect rgb(230,230,255)
        EyeComfort->>ParentItem: topInset = 0
        EyeComfort->>ParentItem: bottomInset = 0
        EyeComfort->>ParentItem: rightItemTopMargin = 6
        EyeComfort->>ParentItem: rightItemBottomMargin = 6
    end
    ParentItem->>DccEditorItem: implicitHeight
    DccEditorItem->>DccEditorItem: implicitHeight = max(48, ...) + topInset + bottomInset
Loading

File-Level Changes

Change Details Files
Ensure the eyeComfort switch row uses a 48px height with a 6px gap to the following group by overriding its layout insets when the parent item is attached.
  • Extend the eyeComfort onParentItemChanged handler to explicitly set topInset and bottomInset to 0 on its parent item.
  • Keep rightItemTopMargin and rightItemBottomMargin at 6 so the switch control’s vertical padding remains unchanged.
  • Rely on DccEditorItem’s additive height calculation and DccGroupView’s default insets to achieve the correct 48px row height and 6px inter-row spacing.
src/plugin-display/qml/DisplayMain.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-bot

deepin-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.105
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3419

@mhduiy
mhduiy force-pushed the fix/eye-comfort-row-height branch from 0493bc1 to 2ffecf9 Compare August 19, 2026 07:48
@mhduiy mhduiy changed the title fix(display): set eyeComfort row height to 48px and 6px gap fix(display): min editor height and eye-care 48px Aug 19, 2026
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 d0b4e85 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,保留 d0b4e85
对单行开关的间距意图。受影响项: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
@mhduiy
mhduiy force-pushed the fix/eye-comfort-row-height branch from 2ffecf9 to 212f676 Compare August 19, 2026 09:49
@mhduiy mhduiy changed the title fix(display): min editor height and eye-care 48px fix(dcc): 48px description rows and min height Aug 19, 2026
@deepin-bot

deepin-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.106
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3497

@deepin-bot

deepin-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.107
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3503

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants