Skip to content

fix(datetime): adapt timezone list and editor item to removed windowT… - #3477

Open
52cyb wants to merge 1 commit into
linuxdeepin:masterfrom
52cyb:run-warning
Open

52cyb wants to merge 1 commit into
linuxdeepin:masterfrom
52cyb:run-warning

Conversation

@52cyb

@52cyb 52cyb commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

…ext writes

  1. TimeAndDate: read the timezone menu item text color from D.ColorSelector.textColor instead of the removed palette.windowText, restoring white text on the highlighted item
  2. DccEditorItem: read the item text color from resolvedTextColor instead of palette.windowText

Log: Adapt dde-control-center to dtkdeclarative removing palette.windowText writes (windowText now returns the inherited default foreground instead of the state-dependent text color)

Influence:

  1. Timezone dropdown highlighted item text stays white in light theme
  2. Settings editor list item selected text color is correct

fix(datetime): 适配时区列表与设置列表项到已移除的 windowText 写入

  1. TimeAndDate:时区菜单项文字色改由 D.ColorSelector.textColor 获取,替代已 移除的 palette.windowText,恢复高亮项白色文字
  2. DccEditorItem:列表项文字色改由 resolvedTextColor 获取,替代 palette.windowText

Log: 适配 dtkdeclarative 移除 palette.windowText 写入(windowText 现返回继承 默认前景色而非随状态变化的文字色)

Influence:

  1. 浅色主题下时区下拉高亮项文字保持白色
  2. 设置页列表项选中文字色正确

PMS: TASK-392413

Summary by Sourcery

Bug Fixes:

  • Restore correct text colors for highlighted timezone menu items and selected settings editor items after the removal of state-dependent palette.windowText writes.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 52cyb

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 Sep 9, 2026

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

Reviewer's Guide

Replaces obsolete palette.windowText bindings with state-aware text-color properties so selected settings items and highlighted timezone entries retain the correct foreground color after dtkdeclarative changes.

File-Level Changes

Change Details Files
Update text-color bindings to use state-aware declarative color properties after windowText writes were removed.
  • Bind editor item text to resolvedTextColor for correct selected-state rendering.
  • Bind highlighted timezone menu text to D.ColorSelector.textColor to preserve contrast in the light theme.
src/dde-control-center/plugin/DccEditorItem.qml
src/plugin-datetime/qml/TimeAndDate.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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/plugin-datetime/qml/TimeAndDate.qml" line_range="443" />
<code_context>
                                         text: parent.parent.text
                                         font: D.DTK.fontManager.t6
-                                        color: parent.parent.palette.windowText
+                                        color: parent.parent.D.ColorSelector.textColor
                                         elide: Text.ElideRight
                                         horizontalAlignment: Text.AlignLeft
</code_context>
<issue_to_address>
**issue (broader_impact):** The second timezone menu delegate in `TimeAndDate.qml` still binds its text to `parent.parent.palette.windowText` (around line 522), so that list's highlighted item continues to use the inherited default foreground instead of the state-dependent highlighted text color.

**Triggers:** When the timezone list opened by `timezoneListWindow` contains a highlighted item in the light theme.

**Suggested fix:** Replace the remaining `palette.windowText` binding in the second timezone delegate with the corresponding `D.ColorSelector.textColor` binding.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread src/plugin-datetime/qml/TimeAndDate.qml
…ext writes

1. TimeAndDate: read the timezone menu item text color from
   `D.ColorSelector.textColor` instead of the removed `palette.windowText`,
   restoring white text on the highlighted item
2. DccEditorItem: read the item text color from `resolvedTextColor` instead
   of `palette.windowText`

Log: Adapt dde-control-center to dtkdeclarative removing palette.windowText
writes (windowText now returns the inherited default foreground instead of
the state-dependent text color)

Influence:
1. Timezone dropdown highlighted item text stays white in light theme
2. Settings editor list item selected text color is correct

fix(datetime): 适配时区列表与设置列表项到已移除的 windowText 写入

1. TimeAndDate:时区菜单项文字色改由 `D.ColorSelector.textColor` 获取,替代已
   移除的 `palette.windowText`,恢复高亮项白色文字
2. DccEditorItem:列表项文字色改由 `resolvedTextColor` 获取,替代
   `palette.windowText`

Log: 适配 dtkdeclarative 移除 palette.windowText 写入(windowText 现返回继承
默认前景色而非随状态变化的文字色)

Influence:
1. 浅色主题下时区下拉高亮项文字保持白色
2. 设置页列表项选中文字色正确

PMS: TASK-392413
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 100 分,大于 70 分通过阈值,代码质量符合要求。本次变更适配 dtkdeclarive 移除 palette.windowText 写入的 API 变更,修改简洁、目的明确,无安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 无需修改,QML 属性绑定语法正确,逻辑清晰


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 无需修改,代码变更简洁、PR描述详尽


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 无需优化,属性绑定变更无性能影响


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 无需安全加固,本次变更不涉及安全相关操作


💡 改进建议代码示例

// 本次变更已为最佳实现,无需额外修复
// DccEditorItem.qml:
//   color: control.resolvedTextColor  // 正确:使用状态相关文字色
//
// TimeAndDate.qml:
//   color: parent.parent.D.ColorSelector.textColor  // 正确:使用 DTK 颜色选择器文字色

本报告由 AI 代码审查工具自动生成

@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

@deepin-bot

deepin-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.109
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3545

This branch has not been deployed

No deployments
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