Skip to content

fix: bind palette to EffectIcon DciIcon for dark theme - #424

Open
JWWTSL wants to merge 1 commit into
linuxdeepin:masterfrom
JWWTSL:agent/pms-bug-bot/d02ffb8b79dc
Open

JWWTSL wants to merge 1 commit into
linuxdeepin:masterfrom
JWWTSL:agent/pms-bug-bot/d02ffb8b79dc

Conversation

@JWWTSL

@JWWTSL JWWTSL commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

fix: bind palette to EffectIcon DciIcon for dark theme

  1. Root cause: EffectIcon's DTK.DciIcon lacked a palette binding,
    so alpha8 DCI icons did not switch to light palette in dark theme
  2. Fix: add palette: DTK.makeIconPalette(propertyPanel.palette) to
    the DciIcon inside EffectIcon, matching ImageViewer.qml usage
  3. Impact: both effect slider endpoint icons (blur/mosaic/graffiti)
    now render correctly in dark theme; light theme unaffected

Log: Fix effect slider endpoint icon color in dark theme

Influence:

  1. Test blur/mosaic/graffiti effect slider endpoint icons in dark theme
  2. Verify endpoint icons display correctly in light theme (no regression)
  3. Test switching themes while edit panel is open

fix: 修复效果滑块端点图标深色主题下颜色异常

  1. 根因:EffectIcon 组件内 DTK.DciIcon 未绑定 palette 属性,导致
    alpha8 格式 DCI 图标在深色主题下不会切换为浅色调色板
  2. 方案:在 EffectIcon 的 DciIcon 中添加 palette:
    DTK.makeIconPalette(propertyPanel.palette),与 ImageViewer.qml
    中的正确用法一致
  3. 影响:效果强度滑块两侧端点图标(高斯模糊/马赛克/涂鸦)在深色
    主题下正确渲染为浅色,浅色主题无回归

Log: 修复效果滑块端点图标深色主题下颜色异常

Influence:

  1. 测试深色主题下高斯模糊/马赛克/涂鸦效果滑块端点图标颜色
  2. 验证浅色主题下端点图标显示无回归
  3. 测试编辑面板打开时切换主题的图标刷新

PMS: BUG-380005

Summary by Sourcery

Bug Fixes:

  • Fix effect slider endpoint icons so they render with the correct palette in dark theme.

1. Root cause: EffectIcon's DTK.DciIcon lacked a palette binding,
   so alpha8 DCI icons did not switch to light palette in dark theme
2. Fix: add palette: DTK.makeIconPalette(propertyPanel.palette) to
   the DciIcon inside EffectIcon, matching ImageViewer.qml usage
3. Impact: both effect slider endpoint icons (blur/mosaic/graffiti)
   now render correctly in dark theme; light theme unaffected

Log: Fix effect slider endpoint icon color in dark theme

Influence:
1. Test blur/mosaic/graffiti effect slider endpoint icons in dark theme
2. Verify endpoint icons display correctly in light theme (no regression)
3. Test switching themes while edit panel is open

fix: 修复效果滑块端点图标深色主题下颜色异常

1. 根因:EffectIcon 组件内 DTK.DciIcon 未绑定 palette 属性,导致
   alpha8 格式 DCI 图标在深色主题下不会切换为浅色调色板
2. 方案:在 EffectIcon 的 DciIcon 中添加 palette:
   DTK.makeIconPalette(propertyPanel.palette),与 ImageViewer.qml
   中的正确用法一致
3. 影响:效果强度滑块两侧端点图标(高斯模糊/马赛克/涂鸦)在深色
   主题下正确渲染为浅色,浅色主题无回归

Log: 修复效果滑块端点图标深色主题下颜色异常

Influence:
1. 测试深色主题下高斯模糊/马赛克/涂鸦效果滑块端点图标颜色
2. 验证浅色主题下端点图标显示无回归
3. 测试编辑面板打开时切换主题的图标刷新

PMS: BUG-380005
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JWWTSL

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 Oct 27, 2026

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

Reviewer's Guide

Adds a theme-aware palette binding to the effect slider endpoint DciIcon, fixing blur, mosaic, and graffiti icon colors in dark mode without changing light-theme behavior.

Sequence diagram for theme-aware effect icon rendering

sequenceDiagram
    participant EditPropertyPanel
    participant EffectIcon
    participant DciIcon
    participant ThemePalette

    EditPropertyPanel->>EffectIcon: create endpoint icon
    EffectIcon->>ThemePalette: makeIconPalette(propertyPanel.palette)
    ThemePalette-->>DciIcon: palette binding
    DciIcon-->>EffectIcon: render alpha8 icon with current theme palette
    ThemePalette-->>DciIcon: update palette on theme switch
    DciIcon-->>EffectIcon: refresh icon colors
Loading

File-Level Changes

Change Details Files
Bind the effect endpoint DCI icon to the panel’s theme-aware icon palette.
  • Pass DTK.makeIconPalette(propertyPanel.palette) to the DciIcon palette property.
  • Ensure alpha8 effect icons follow dark/light theme palette updates while the edit panel is open.
src/qml/EditPropertyPanel.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 reviewed your changes and they look great!


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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交修复深色主题下 EffectIcon/DciIcon 调色板绑定问题,新增单行 palette 属性绑定,语法正确、逻辑清晰,无安全漏洞,无性能问题,代码质量良好。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

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

建议: 无改进建议


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

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

建议: 无改进建议


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

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

建议: 无改进建议


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

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

建议: 无改进建议


💡 改进建议代码示例

当前代码已正确修复深色主题适配问题,无需额外修改: ```qml // src/qml/EditPropertyPanel.qml (第 105 行附近) DTK.Control {
    // ...
    EffectIcon {
        anchors.centerIn: parent
        height: parent.iconHeight
        name: parent.iconName
        palette: DTK.makeIconPalette(propertyPanel.palette)  // 新增:绑定 palette 支持深色主题
        sourceSize.height: parent.iconHeight
        sourceSize.width: parent.iconWidth
        width: parent.iconWidth
    }
} ```

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

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