Skip to content

fix(slider): align tick highlight background with checked button style - #755

Merged
18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
zqq-dora:fix-slider-tick-checked-style
Nov 18, 2026
Merged

18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
zqq-dora:fix-slider-tick-checked-style

Conversation

@zqq-dora

@zqq-dora zqq-dora commented Nov 17, 2026 •

Copy link
Copy Markdown

Problem

Slider tick highlight background uses HighlightPanel with default highlightPanel.* color tokens, which differ from the checked button style used by transparent (flat) buttons in checked state.

Change

  • Bind HighlightPanel color properties (backgroundColor, outerShadowColor, innerShadowColor) to DS.Style.checkedButton.* tokens in SliderTipItem.qml, so the tick selected background matches the transparent button's checked appearance.

Files

File Change
qt6/src/qml/SliderTipItem.qml Bind HighlightPanel to checkedButton color tokens

问题

Slider 刻度选中背景使用 HighlightPanel 的默认 highlightPanel.* 颜色,与 transparent button 的 checked 样式不一致。

修改

  • 在 SliderTipItem.qml 中将 HighlightPanel 的颜色属性绑定到 DS.Style.checkedButton.*,使刻度选中背景与 checked 按钮样式一致。

涉及文件

文件 改动
qt6/src/qml/SliderTipItem.qml HighlightPanel 绑定 checkedButton 颜色

slider tick highlight

@sourcery-ai

sourcery-ai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

UI

Bind the slider tick HighlightPanel colors to checked-button tokens so its selected background matches checked transparent buttons.

  • qt6/src/qml/SliderTipItem.qml L71-75

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-ci-robot

Copy link
Copy Markdown
Contributor

Hi @zqq-dora. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@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 3 issues

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

## Individual Comments

### Comment 1
<location path="qt6/src/qml/SliderTipItem.qml" line_range="72-74" />
<code_context>
                 active: highlight
-                sourceComponent: HighlightPanel { }
+                sourceComponent: HighlightPanel {
+                    backgroundColor: DS.Style.checkedButton.background
+                    outerShadowColor: DS.Style.checkedButton.dropShadow
+                    innerShadowColor: DS.Style.checkedButton.innerShadow
+                }
             }
</code_context>
<issue_to_address>
**Highlight differs from flat buttons**

When a highlighted slider tick is compared with a checked `ToolButton`, an active tick uses `DS.Style.checkedButton` palettes, while `ToolButton` is flat and uses `DS.Style.toolButton.checkedBackground` and `checkedShadow` when checked. The tick highlight therefore does not match the checked appearance of those flat buttons.

Use the same checked palette tokens as the flat button style the tick is meant to match.
</issue_to_address>

### Comment 2
<location path="qt6/src/qml/SliderTipItem.qml" line_range="73-74" />
<code_context>
-                sourceComponent: HighlightPanel { }
+                sourceComponent: HighlightPanel {
+                    backgroundColor: DS.Style.checkedButton.background
+                    outerShadowColor: DS.Style.checkedButton.dropShadow
+                    innerShadowColor: DS.Style.checkedButton.innerShadow
+                }
             }
</code_context>
<issue_to_address>
**Selected tick misses button shading**

When the checked-button style has visible shadow layers, including in dark mode, `HighlightPanel.outerShadowColor` is not rendered because its `BoxShadow` is commented out, and the panel receives only `checkedButton.innerShadow`, not the checked button’s separate `innerShadow2`. The selected tick therefore lacks shading that the checked button renders, so the two appearances still differ.

Render the outer shadow and the checked style’s second inner-shadow layer in `HighlightPanel`, and bind the corresponding checked-button palettes.
</issue_to_address>

### Comment 3
<location path="qt6/src/qml/SliderTipItem.qml" line_range="72-75" />
<code_context>
                 active: highlight
-                sourceComponent: HighlightPanel { }
+                sourceComponent: HighlightPanel {
+                    backgroundColor: DS.Style.checkedButton.background
+                    outerShadowColor: DS.Style.checkedButton.dropShadow
+                    innerShadowColor: DS.Style.checkedButton.innerShadow
+                }
             }
         }
</code_context>
<issue_to_address>
**Selected tick corners remain larger**

When a highlighted tick is displayed, `HighlightPanel.radius` retains `DS.Style.highlightPanel.radius` (8), while checked buttons use `DS.Style.button.radius` (6). The selected tick therefore keeps visibly rounder corners instead of matching the checked button.

Set the `HighlightPanel` radius to the checked button radius.
</issue_to_address>

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

Comment on lines +72 to +74
backgroundColor: DS.Style.checkedButton.background
outerShadowColor: DS.Style.checkedButton.dropShadow
innerShadowColor: DS.Style.checkedButton.innerShadow

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Highlight differs from flat buttons

When a highlighted slider tick is compared with a checked ToolButton, an active tick uses DS.Style.checkedButton palettes, while ToolButton is flat and uses DS.Style.toolButton.checkedBackground and checkedShadow when checked. The tick highlight therefore does not match the checked appearance of those flat buttons.

Use the same checked palette tokens as the flat button style the tick is meant to match.

Prompt for AI agents
In `qt6/src/qml/SliderTipItem.qml` at lines 72-74:

**Highlight differs from flat buttons**

When a highlighted slider tick is compared with a checked `ToolButton`, an active tick uses `DS.Style.checkedButton` palettes, while `ToolButton` is flat and uses `DS.Style.toolButton.checkedBackground` and `checkedShadow` when checked. The tick highlight therefore does not match the checked appearance of those flat buttons.

Use the same checked palette tokens as the flat button style the tick is meant to match.

Comment on lines +73 to +74
outerShadowColor: DS.Style.checkedButton.dropShadow
innerShadowColor: DS.Style.checkedButton.innerShadow

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Selected tick misses button shading

When the checked-button style has visible shadow layers, including in dark mode, HighlightPanel.outerShadowColor is not rendered because its BoxShadow is commented out, and the panel receives only checkedButton.innerShadow, not the checked button’s separate innerShadow2. The selected tick therefore lacks shading that the checked button renders, so the two appearances still differ.

Render the outer shadow and the checked style’s second inner-shadow layer in HighlightPanel, and bind the corresponding checked-button palettes.

Prompt for AI agents
In `qt6/src/qml/SliderTipItem.qml` at lines 73-74:

**Selected tick misses button shading**

When the checked-button style has visible shadow layers, including in dark mode, `HighlightPanel.outerShadowColor` is not rendered because its `BoxShadow` is commented out, and the panel receives only `checkedButton.innerShadow`, not the checked button’s separate `innerShadow2`. The selected tick therefore lacks shading that the checked button renders, so the two appearances still differ.

Render the outer shadow and the checked style’s second inner-shadow layer in `HighlightPanel`, and bind the corresponding checked-button palettes.

Comment on lines +72 to +75
backgroundColor: DS.Style.checkedButton.background
outerShadowColor: DS.Style.checkedButton.dropShadow
innerShadowColor: DS.Style.checkedButton.innerShadow
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ Low · Selected tick corners remain larger

When a highlighted tick is displayed, HighlightPanel.radius retains DS.Style.highlightPanel.radius (8), while checked buttons use DS.Style.button.radius (6). The selected tick therefore keeps visibly rounder corners instead of matching the checked button.

Set the HighlightPanel radius to the checked button radius.

Prompt for AI agents
In `qt6/src/qml/SliderTipItem.qml` at lines 72-75:

**Selected tick corners remain larger**

When a highlighted tick is displayed, `HighlightPanel.radius` retains `DS.Style.highlightPanel.radius` (8), while checked buttons use `DS.Style.button.radius` (6). The selected tick therefore keeps visibly rounder corners instead of matching the checked button.

Set the `HighlightPanel` radius to the checked button radius.

@zqq-dora
zqq-dora force-pushed the fix-slider-tick-checked-style branch 3 times, most recently from 388a092 to 54e8f62 Compare November 18, 2026 03:02
@18202781743

Copy link
Copy Markdown
Contributor

slider-tick-highlight.png 这种示意图,放在pr里就行,也可以放在docs里,但不要放在src这种代码里,它不参与编译,

The slider tick highlight background uses HighlightPanel with default
highlightPanel.* color tokens, which differ from the checked button
style. Bind the HighlightPanel color properties to checkedButton.*
tokens so the tick selected background matches the transparent button
checked appearance.
@zqq-dora
zqq-dora force-pushed the fix-slider-tick-checked-style branch from 54e8f62 to 2c74e55 Compare November 18, 2026 03:15
@zqq-dora

Copy link
Copy Markdown
Author

截图参考如下:

slider-tick-highlight

@18202781743 已将截图从代码中移除,改为在评论中展示。

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, zqq-dora

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

@18202781743
18202781743 merged commit 7ea89aa into linuxdeepin:v25-flowstyle Nov 18, 2026
18 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants