Skip to content

feat: add palette dconfig configuration for dtk - #155

Open
18202781743 wants to merge 1 commit into
masterfrom
feat/palette-dconfig
Open

18202781743 wants to merge 1 commit into
masterfrom
feat/palette-dconfig

Conversation

@18202781743

@18202781743 18202781743 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

背景

将 dtkgui 中硬编码的调色板颜色值迁移到 dconfig 配置,使用 subpath(light/dark)区分亮暗主题。

改动内容

新增 3 个 dsg.config.meta JSON 文件:

  • configs/org.deepin.dtk.palette.json — base,light 值作默认
  • configs/light/org.deepin.dtk.palette.json — light,与 base 完全相同
  • configs/dark/org.deepin.dtk.palette.json — dark,dark 值

共 32 个 key(20 QPalette + 12 DPalette),每个 key 含 8 个必需字段(value / serial / name / name[zh_CN] / description / description[zh_CN] / permissions / visibility)。

所有非空 value 统一使用 #AARRGGBB 八位格式(大写)。alpha 值按 C++ double→int 截断换算(如 0.7×255=178→0xB2)。NoType 用空字符串 "" 表示 invalid QColor。

所有 key 已去除 qPalette / dPalette 前缀,name 字段使用语义化中英文名称。

install 规则

无需修改 CMakeLists.txt 或 debian/libdtkdata.install,现有规则已递归覆盖子目录。

验证

  • base == light(字节级完全相同)
  • base vs dark:仅 28 对 value 不同
  • alpha 截断值逐项与 C++ 编译验证结果匹配
  • 构建打包验证通过(libdtkdata_6.7.49_amd64.deb)
  • 代码审核 97 分通过

关联

Summary by Sourcery

Add dconfig palette metadata to support configurable light and dark DTK color themes.

New Features:

  • Add palette configuration metadata for light and dark themes, covering QPalette and DPalette color settings.

Enhancements:

  • Migrate palette values from hard-coded definitions to dconfig-managed settings with semantic bilingual names and standardized color values.

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

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

@18202781743
18202781743 marked this pull request as ready for review September 22, 2026 04:16
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743

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 22, 2026 •

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

Reviewer's Guide

Introduces dconfig palette metadata for DTK, separating light and dark theme values through subpaths while preserving the existing installation flow. The definitions cover all QPalette and DPalette entries with standardized color encoding and complete metadata.

File-Level Changes

Change Details Files
Add base and theme-specific dconfig metadata for DTK palette colors.
  • Define 20 QPalette and 12 DPalette keys in each metadata file.
  • Use the base/light metadata as the light-theme defaults and provide dark-theme values under the dark subpath.
  • Represent colors as uppercase #AARRGGBB values, including C++-compatible truncated alpha conversion and empty values for NoType.
  • Provide required metadata fields with semantic English and Chinese names, descriptions, permissions, and visibility.
  • Rely on existing recursive installation rules without changing build or packaging files.
configs/org.deepin.dtk.palette.json
configs/light/org.deepin.dtk.palette.json
configs/dark/org.deepin.dtk.palette.json

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 reviewed your changes and they look great!


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

@github-actions

Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot:

如果你是以企业贡献者的身份进行提交,请联系我们签署企业贡献者许可协议
If you submit as corporate contributor, please contact us to sign our Corporate Contributor License Agreement

感谢您的提交,我们非常感谢。 像许多开源项目一样,在接受您的贡献之前,我们要求您签署我们的个人贡献者许可协议。 您只需发布与以下格式相同的评论即可签署个人贡献者许可协议。
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Individual Contributor License Agreement before we can accept your contribution. You can sign the Individual Contributor License Agreement by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA.

shuttle slave seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

@18202781743
18202781743 force-pushed the feat/palette-dconfig branch 2 times, most recently from ec94502 to c427b78 Compare September 22, 2026 09:55
feat: 在 dtk preference dconfig 中新增调色板颜色数组

1. Delete org.deepin.dtk.palette.json and org.deepin.dtk.palette.dark.json
2. Add 4 array keys to org.deepin.dtk.preference.json: lightQPalette, darkQPalette, lightDPalette, darkDPalette
3. Each array contains #AARRGGBB color strings ordered by QPalette::ColorRole or DPalette::ColorType enum
4. Reuse existing org.deepin.dtk.preference dconfig instance instead of separate palette schema files
5. Use camelCase naming for config keys

1. 删除 org.deepin.dtk.palette.json 和 org.deepin.dtk.palette.dark.json
2. 在 org.deepin.dtk.preference.json 中新增 4 个数组配置项:lightQPalette、darkQPalette、lightDPalette、darkDPalette
3. 每个数组包含按 QPalette::ColorRole 或 DPalette::ColorType 枚举顺序排列的 #AARRGGBB 颜色字符串
4. 复用已有的 org.deepin.dtk.preference dconfig 实例,不再使用独立的 palette schema 文件
5. 配置项 key 使用小驼峰命名

PMS: DDE-330
Log: 迁移调色板颜色配置到 dconfig,使用数组型配置项替代独立 palette schema 文件,配置项使用小驼峰命名
Influence: 无
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 未发现安全漏洞,代码结构清晰,JSON格式有效,调色板配置完整且符合dsg.config.meta规范。新增的4个调色板颜色数组配置(lightQPalette、darkQPalette、lightDPalette、darkDPalette)结构规范,字段完整,命名一致,中英文描述齐全。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

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

建议: []


2. 代码质量 ✅

评价: 优秀 ✅ 通过

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

建议: []


3. 代码性能 ✅

评价: 优秀 ✅ 通过

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

建议: []


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

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

建议: []


💡 改进建议代码示例

// 暂无代码示例

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

@deepin-bot

deepin-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.7.51
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #157

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