Skip to content

feat: add org.deepin.dtk.palette dconfig for palette colors - #154

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

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

Conversation

@18202781743

@18202781743 18202781743 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

背景

DDE-330: 调色板类型值迁移到 dconfig 配置

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

改动内容

新增 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。

install 规则

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

  • CMakeLists.txt: install(DIRECTORY configs DESTINATION "share/dsg" FILES_MATCHING PATTERN "*")
  • debian/libdtkdata.install: usr/share/dsg/configs/*

验证

  • base == light(字节级完全相同)
  • base vs dark:仅 28 对 value 不同(qPaletteShadow / qPaletteLink / qPaletteLinkVisited / dPaletteNoType 4 项相同)
  • alpha 截断值逐项与 C++ 编译验证结果匹配
  • 所有非空 value 为大写 #AARRGGBB 格式

关联

  • Multica Issue: DDE-330

Summary by Sourcery

Add dconfig palette metadata to provide configurable light and dark theme colors for DTK palettes.

New Features:

  • Add base, light-theme, and dark-theme dconfig metadata for 20 QPalette and 12 DPalette color values.

Enhancements:

  • Move palette color definitions into configurable theme-specific metadata with standardized color value formatting.

@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

@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 16, 2026

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

Reviewer's Guide

This PR migrates hard-coded dtkgui palette colors into dconfig metadata by adding synchronized base/light and dark theme configuration files, with validated color encoding and complete metadata for all 32 QPalette and DPalette keys; existing recursive installation rules require no changes.

File-Level Changes

Change Details Files
Add palette color dconfig metadata for base, light, and dark theme variants.
  • Define 32 palette keys covering 20 QPalette and 12 DPalette entries.
  • Provide the required metadata fields, permissions, and visibility for every key.
  • Use uppercase #AARRGGBB values, including truncated alpha conversions, and represent NoType as an empty value.
  • Keep the base configuration identical to light and provide dark-specific values through the dark subpath.
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

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@18202781743
18202781743 force-pushed the feat/palette-dconfig branch 3 times, most recently from 797e757 to 0034608 Compare September 22, 2026 03:36
1. Add org.deepin.dtk.palette.json base config with 32 color keys
2. Add light and dark subpath configs for theme-specific palette values
3. Use #AARRGGBB format with alpha truncation matching C++ values
4. Keys use semantic names without qPalette/dPalette prefixes

Influence:
1. Verify palette config files are installed to /usr/share/dsg/configs/
2. Verify all 32 keys present in base, light, and dark configs
3. Verify light config matches base, dark config has correct dark values

feat: 添加调色板 dconfig 配置

1. 新增 org.deepin.dtk.palette.json 基础配置,包含 32 个颜色 key
2. 新增 light 和 dark subpath 配置,区分亮暗主题色值
3. 使用 #AARRGGBB 格式,alpha 截断值与 C++ 一致
4. key 使用语义化名称,去除 qPalette/dPalette 前缀

Influence:
1. 验证调色板配置文件安装到 /usr/share/dsg/configs/
2. 验证 base、light、dark 三个配置均包含 32 个 key
3. 验证 light 配置与 base 一致,dark 配置暗色值正确
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