Skip to content

fix(slider): correct dash pattern spacing and groove shadow visibility - #754

Merged
18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
zqq-dora:fix-slider-dash-shadow
Nov 16, 2026
Merged

18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
zqq-dora:fix-slider-dash-shadow

Conversation

@zqq-dora

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

Copy link
Copy Markdown

Follow-up fix to #750 for the slider dashed groove.

Changes

  • Fix dashed groove spacing: change dashPattern from [1, 1] to [1, 0.5]. With strokeWidth: 2, this produces 2px dash / 1px gap, matching the design spec. The previous [1, 1] produced equal 2px / 2px, making the gap appear too wide.
  • Fix highlight groove shadow visibility: add visible: D.DTK.themeType === D.ApplicationHelper.DarkType to the BoxShadow. The shadow is now only shown in dark mode, hidden in light mode.

针对 #750 的 slider 虚线 groove 后续修复。

修改内容

  • 修复虚线间距:将 dashPattern 从 [1, 1] 改为 [1, 0.5]。配合 strokeWidth: 2,实际效果为 2px 线段 / 1px 间距,符合设计图规格。之前的 [1, 1] 产生 2px / 2px 等宽虚线,间距偏大。
  • 修复高亮虚线投影:给 BoxShadow 添加 visible: D.DTK.themeType === D.ApplicationHelper.DarkType。投影仅在深色模式下显示,浅色模式隐藏。

Summary by Sourcery

Correct slider groove dash spacing and theme-dependent shadow visibility.

Bug Fixes:

  • Correct the slider dashed groove spacing to match the design specification.
  • Limit the highlighted groove shadow to dark mode so it does not appear in light mode.

- Fix dash pattern from [1, 1] to [1, 0.5] to match design spec (2px dash, 1px gap).
- Show highlight groove BoxShadow only in dark mode, hide in light mode.
@sourcery-ai

sourcery-ai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

UI

Correct the slider groove dash spacing and show its highlight shadow only in dark mode.

  • qt6/src/qml/Slider.qml L28-30, L141

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 2 issues

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

## Individual Comments

### Comment 1
<location path="qt6/src/qml/Slider.qml" line_range="141" />
<code_context>
                         shadowColor: control.palette.highlight
                         rotation: control.horizontal ? 0 : 180
                         opacity: 0.25
+                        visible: D.DTK.themeType === D.ApplicationHelper.DarkType
                     }
                 }
</code_context>
<issue_to_address>
**Light-theme sliders show shadow**

When the project is built with DTK5, uses a light theme, and `highlightedPassedGroove` is enabled, `src/qml/Slider.qml` leaves the highlighted-groove `BoxShadow` without a theme-dependent `visible` binding, so the shadow remains visible.

Add a theme-dependent `visible` binding to the highlighted-groove `BoxShadow` in `src/qml/Slider.qml`.
</issue_to_address>

### Comment 2
<location path="qt6/src/qml/Slider.qml" line_range="141" />
<code_context>
                         shadowColor: control.palette.highlight
                         rotation: control.horizontal ? 0 : 180
                         opacity: 0.25
+                        visible: D.DTK.themeType === D.ApplicationHelper.DarkType
                     }
                 }
</code_context>
<issue_to_address>
**Window theme shows wrong shadow**

When a window’s theme is overridden independently of the application-wide theme, the visibility binding reads the application-wide theme instead of the slider’s `controlTheme`, so a light-themed window under a globally dark theme still shows the shadow.

Bind visibility to `control.D.ColorSelector.controlTheme === D.ApplicationHelper.DarkType` so it follows the slider’s effective theme.
</issue_to_address>

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

Comment thread qt6/src/qml/Slider.qml
shadowColor: control.palette.highlight
rotation: control.horizontal ? 0 : 180
opacity: 0.25
visible: D.DTK.themeType === D.ApplicationHelper.DarkType

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 · Light-theme sliders show shadow

When the project is built with DTK5, uses a light theme, and highlightedPassedGroove is enabled, src/qml/Slider.qml leaves the highlighted-groove BoxShadow without a theme-dependent visible binding, so the shadow remains visible.

Add a theme-dependent visible binding to the highlighted-groove BoxShadow in src/qml/Slider.qml.

Prompt for AI agents
In `qt6/src/qml/Slider.qml` at line 141:

**Light-theme sliders show shadow**

When the project is built with DTK5, uses a light theme, and `highlightedPassedGroove` is enabled, `src/qml/Slider.qml` leaves the highlighted-groove `BoxShadow` without a theme-dependent `visible` binding, so the shadow remains visible.

Add a theme-dependent `visible` binding to the highlighted-groove `BoxShadow` in `src/qml/Slider.qml`.

Comment thread qt6/src/qml/Slider.qml
shadowColor: control.palette.highlight
rotation: control.horizontal ? 0 : 180
opacity: 0.25
visible: D.DTK.themeType === D.ApplicationHelper.DarkType

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 · Window theme shows wrong shadow

When a window’s theme is overridden independently of the application-wide theme, the visibility binding reads the application-wide theme instead of the slider’s controlTheme, so a light-themed window under a globally dark theme still shows the shadow.

Bind visibility to control.D.ColorSelector.controlTheme === D.ApplicationHelper.DarkType so it follows the slider’s effective theme.

Prompt for AI agents
In `qt6/src/qml/Slider.qml` at line 141:

**Window theme shows wrong shadow**

When a window’s theme is overridden independently of the application-wide theme, the visibility binding reads the application-wide theme instead of the slider’s `controlTheme`, so a light-themed window under a globally dark theme still shows the shadow.

Bind visibility to `control.D.ColorSelector.controlTheme === D.ApplicationHelper.DarkType` so it follows the slider’s effective theme.

@zqq-dora

zqq-dora commented Nov 16, 2026 •

Copy link
Copy Markdown
Author

Verified the fixed slider effect:

slider-effect

Dash pattern is now 2px dash / 1px gap, and the highlight groove shadow only appears in dark mode.


修改后的 slider 效果验证:

slider-effect

虚线间距已修正为 2px 线段 / 1px 间距,高亮虚线投影仅在深色模式下显示。

@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 46c4d01 into linuxdeepin:v25-flowstyle Nov 16, 2026
18 of 19 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