Skip to content

ToolButton: 深色模式 hover/pressed 毛玻璃效果 + checked 状态样式重构 - #672

Open
zqq-dora wants to merge 1 commit into
linuxdeepin:v25-flowstylefrom
zqq-dora:feat/toolbutton-dark-hover-pressed
Open

ToolButton: 深色模式 hover/pressed 毛玻璃效果 + checked 状态样式重构#672
zqq-dora wants to merge 1 commit into
linuxdeepin:v25-flowstylefrom
zqq-dora:feat/toolbutton-dark-hover-pressed

Conversation

@zqq-dora

@zqq-dora zqq-dora commented Aug 26, 2026

Copy link
Copy Markdown

ToolButton: 深色模式 hover/pressed 毛玻璃效果 + checked 状态样式重构

背景

ToolButton 在深色模式下的 hover/pressed 样式效果不理想:hover 时使用的是浅灰色 tint(rgba(1,1,1,0.15)),缺乏层次感和质感;checked 状态复用了 Button 的 accent 填充样式,视觉上与 ToolButton 的轻量风格不匹配。

本 PR 重新设计了 ToolButton 的深色模式 hover/pressed 样式,并重构了 checked 状态的独立样式。

修改内容

1. 深色模式 hover 效果(毛玻璃)

深色模式 hover 新增了背景模糊(backdrop blur)效果,模拟设计稿中的磨砂玻璃质感:

  • 背景模糊 radius: 15saturation: 100%
  • 背景色 rgba(20, 20, 20, 0.2) 半透明深色 tint
  • 顶部 1px 白色内阴影 rgba(255, 255, 255, 0.1)(高光)
  • 底部 1px 黑色内阴影 rgba(0, 0, 0, 0.5)(暗角)
  • 圆角 6px

模糊效果通过 D.InWindowBlur 实现,使用 D.ItemViewport 裁剪到圆角形状。模糊功能受平台限制(valid 属性门控),在不支持的平台仅显示 tint + 内阴影。

2. 深色模式 pressed 效果

深色模式 pressed 使用纯色 tint rgba(0, 0, 0, 0.15),不叠加模糊和内阴影,保持简洁。

3. checked 状态样式重构

checked 状态不再复用 Button 的 accent 填充样式,改为独立的 overlay chip 样式:

  • 背景:浅色模式 rgba(0, 0, 0, 0.1~0.15),深色模式 rgba(0, 0, 0, 0.3~0.35)
  • 文字/图标:统一使用 Highlight 强调色
  • 底部 1px 内阴影:浅色 rgba(0, 0, 0, 0.1),深色 rgba(0, 0, 0, 0.5)

4. InWindowBlur 组件增强

InWindowBlur.qml 新增 saturation 属性别名,暴露 MultiEffect 的饱和度参数,使 ToolButton 的深色 hover 可以设置 100% 饱和度。

涉及文件

文件 改动
qt6/src/qml/overridable/InWindowBlur.qml 新增 saturation 属性别名
qt6/src/qml/FlowStyle.qml toolButton QtObject 新增 radiuscheckedBackgroundcheckedTextcheckedShadowhoverBackground 属性
qt6/src/qml/ToolButton.qml 重构 textColorbackground 的 Binding 逻辑,新增深色 hover 毛玻璃和内阴影、checked 状态独立样式

已知限制

  • 背景模糊(backdrop blur)依赖平台 GPU 支持,在软件渲染或不支持 InWindowBlur 的环境下会降级为纯 tint + 内阴影(仅去掉模糊,视觉效果保持一致)
  • ButtonBox 有自己的 backgroundPanel 动画覆盖层,与本 PR 的 ToolButton hover 样式独立,不在本次修改范围内

Summary by Sourcery

Refine ToolButton state styling to provide polished dark-mode interactions and a lightweight checked appearance.

New Features:

  • Add dark-mode frosted-glass hover styling and simplified pressed styling for ToolButton.
  • Expose saturation control through InWindowBlur for component consumers.

Enhancements:

  • Refactor ToolButton checked-state visuals into a lightweight overlay chip with accent-colored text/icons and theme-specific inset shadows.
  • Centralize ToolButton dimensions and state palettes in FlowStyle.

- 深色 hover: backdrop blur(radius=15, saturation=100%) + rgba(20,20,20,0.2) tint + 白色顶部/黑色底部内阴影
- 深色 pressed: rgba(0,0,0,0.15) 纯色 tint
- checked 状态: 独立 overlay chip 样式(checkedBackground/checkedText/checkedShadow)
- InWindowBlur: 新增 saturation 属性别名
- FlowStyle toolButton: 新增 radius/checkedBackground/checkedText/checkedShadow/hoverBackground
- 简化 textColor 冗余 if/else 死代码
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 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

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

Hi @zqq-dora. Thanks for your PR. 😃

@github-actions

Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot:
提交邮箱中包含我们的合作伙伴,但您似乎并非合作伙伴的成员或对接人,请联系相关对接人将您添加至组织之中,或由其重新发起 Pull Request。
The commit email domain belongs to one of our partners, but it seems you are not yet a member of the current organization, please contact the contact person to add you to the organization or let them submit the Pull Request.

You can retrigger this bot by commenting recheck in this Pull Request

@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 commented Aug 26, 2026

Copy link
Copy Markdown

Reviewer's Guide

本 PR 通过新增 ToolButton 专用主题调色板和状态绑定,彻底分离 checked 样式与通用 Button accent 填充,并利用平台能力门控的 InWindowBlur、圆角裁剪及内阴影实现深色 hover 毛玻璃效果;同时扩展 InWindowBlur 的 saturation 配置。

Sequence diagram for ToolButton state-dependent overlays

sequenceDiagram
    participant User
    participant ToolButton
    participant ColorSelector
    participant ButtonPanel
    participant InWindowBlur
    participant ItemViewport
    participant BoxInsetShadow

    User->>ToolButton: hover or press
    ToolButton->>ColorSelector: controlState
    ColorSelector-->>ButtonPanel: HoveredState or PressedState
    alt dark theme hover
        ButtonPanel->>InWindowBlur: radius and saturation
        InWindowBlur->>ItemViewport: clip hoverBlur.content to radius
        InWindowBlur-->>ButtonPanel: blur when valid
        ButtonPanel->>BoxInsetShadow: show top highlight and bottom shadow
    else non-checked hover or press
        ButtonPanel-->>ToolButton: apply hoverBackground
    end
    alt checked
        ToolButton-->>ButtonPanel: apply checkedBackground
        ToolButton-->>ToolButton: apply checkedText
        ButtonPanel->>BoxInsetShadow: apply checkedShadow
    end
Loading

File-Level Changes

Change Details Files
集中扩展 ToolButton 的主题配置,为 checked、hover 和 pressed 状态提供独立的颜色、阴影及圆角参数。
  • 新增 checked overlay、Highlight 文本色、底部内阴影和 hover/pressed 背景调色板。
  • 将 ToolButton 的圆角统一纳入样式配置。
qt6/src/qml/FlowStyle.qml
重构 ToolButton 的状态渲染,使 checked 状态采用轻量 overlay chip,并为深色 hover 增加可降级的毛玻璃和内阴影效果。
  • 通过状态条件 Binding 分离 checked 与非 checked 的背景、可见性和文本色逻辑。
  • 使用 InWindowBlur、ItemViewport 和两层 BoxInsetShadow 实现深色 hover 的模糊、高光及暗角效果。
  • 为 checked chip 添加 Highlight 内容色和底部内阴影,并保持 pressed 状态使用纯色覆盖。
qt6/src/qml/ToolButton.qml
扩展窗口内模糊组件对 MultiEffect 饱和度参数的暴露能力。
  • 新增 saturation 属性别名,供 ToolButton 配置 100% 饱和度。
qt6/src/qml/overridable/InWindowBlur.qml
调整 FlowStyle.qml 的结构布局,将既有样式对象从原位置移除并重新归入文件末尾区域。
  • 检查被移动的 submenu、panel、delegate、indicator、bar、progress、slider 等样式对象是否完整保留及作用域未变。
qt6/src/qml/FlowStyle.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 found 3 issues

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

## Individual Comments

### Comment 1
<location path="qt6/src/qml/FlowStyle.qml" line_range="822-823" />
<code_context>
         // the highlight color of main menu item, when submenu is opened.
</code_context>
<issue_to_address>
**issue (bug_risk):** FlowStyle.qml ends with an incomplete `property D.Palette submenuOpenedItemHigh` declaration after deleting the remainder of the style object. QML parsing fails, so the style module cannot be loaded and every component importing `DS.Style` fails to instantiate.

**Suggested fix:** Restore the deleted FlowStyle contents and complete the `submenuOpenedItemHighlight` declaration and closing braces.
</issue_to_address>

### Comment 2
<location path="qt6/src/qml/FlowStyle.qml" line_range="822-823" />
<code_context>
         // the highlight color of main menu item, when submenu is opened.
</code_context>
<issue_to_address>
**issue (broader_impact):** The change removes the existing style objects after the toolButton section, including `highlightPanel`, `behindWindowBlur`, `arrowRectangleBlur`, `itemDelegate`, `scrollBar`, `progressBar`, `titleBar`, and related properties that remain referenced by QML components. Those references resolve to undefined style objects at runtime even if the truncated FlowStyle declaration is repaired.

**Triggers:** When any component using one of the removed DS.Style properties is loaded.

**Suggested fix:** Keep all unrelated FlowStyle properties and only add the new toolButton properties.
</issue_to_address>

### Comment 3
<location path="qt6/src/qml/ToolButton.qml" line_range="205" />
<code_context>
+            visible: control.checked
+            z: D.DTK.AboveOrder
+            cornerRadius: buttonPanel.radius
+            shadowColor: control.D.ColorSelector.checkedShadow
+            shadowOffsetX: 0
+            shadowOffsetY: -1
</code_context>
<issue_to_address>
**issue (bug_risk):** `D.ColorSelector` exposes palette colors using the `...Color` naming convention, but the checked shadow is read as `control.D.ColorSelector.checkedShadow`. That attached property is undefined, so the checked chip's `shadowColor` does not receive the configured palette color and can produce an invalid binding/runtime warning.

**Triggers:** When a ToolButton is checked and the checked shadow is evaluated.

**Suggested fix:** Use the ColorSelector-exposed checked shadow color property, such as `control.D.ColorSelector.checkedShadowColor`, or bind directly to the `checkedShadow` palette through a supported selector API.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread qt6/src/qml/FlowStyle.qml
Comment on lines 822 to +823
// the highlight color of main menu item, when submenu is opened.
property D.Palette submenuOpenedItemHighlight: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.15)
normalDark: Qt.rgba(1, 1, 1, 0.2)
}

property D.Palette itemHighlightShadow: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.2)
normalDark: Qt.rgba(1, 1, 1, 0.1)
}

property D.Palette itemText: D.Palette {
normal: ("black")
normalDark: ("white")
}

property D.Palette separatorText: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.5)
normalDark: Qt.rgba(1, 1, 1, 0.4)
}
}

// Panel
property QtObject highlightPanel: QtObject {
property int width: 180
property int height: 30
property int radius: 8

property D.Palette background: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight)
normalDark: D.DTK.makeColor(D.Color.Highlight)
hovered: D.DTK.makeColor(D.Color.Highlight).lightness(+10)
hoveredDark: D.DTK.makeColor(D.Color.Highlight).lightness(+10)
}
property D.Palette dropShadow: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight).lightness(+20).opacity(-80)
normalDark: D.DTK.makeColor(D.Color.Highlight).lightness(+20).opacity(-80)
}
property D.Palette innerShadow: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight).lightness(-20)
normalDark: D.DTK.makeColor(D.Color.Highlight).lightness(-20)
}
}

property QtObject behindWindowBlur: QtObject {
property color lightColor: Qt.rgba(235 / 255.0, 235 / 255.0, 235 / 255.0, 0.6)
property color lightNoBlurColor: Qt.rgba(235 / 255.0, 235 / 255.0, 235 / 255.0, 1.0)
property color darkColor: "#55000000"
property color darkNoBlurColor: Qt.rgba(35 / 255.0, 35 / 255.0, 35 / 255.0, 1.0)
}

property QtObject arrowRectangleBlur: QtObject {
property int borderWidth: 1
property int roundJoinRadius: 8
property color outBorderColor: Qt.rgba(0, 0, 0, 0.06)
property color darkOutBorderColor: Qt.rgba(0, 0, 0, 0.8)
property color inBorderColor: Qt.rgba(1, 1, 1, 0.1)
property color darkInBorderColor: Qt.rgba(1, 1, 1, 0.8)
property color backgroundColor: behindWindowBlur.lightColor
property color darkBackgroundColor: behindWindowBlur.darkColor
property color backgroundNoBlurColor: behindWindowBlur.lightNoBlurColor
property color darkBackgroundNoBlurColor: behindWindowBlur.darkNoBlurColor
property color shadowColor: Qt.rgba(0, 0, 0, 0.2)
property color darkShadowColor: Qt.rgba(0, 0, 0, 0.2)
}

property QtObject arrowListView: QtObject {
property int width: 180
property size stepButtonSize: Qt.size(16, 16)
property size stepButtonIconSize: Qt.size(12, 12)
property int maxVisibleItems: 16
property int itemHeight: 30
property string upButtonIconName: "arrow_ordinary_up"
property string downButtonIconName: "arrow_ordinary_down"
}

property QtObject itemDelegate: QtObject {
property int width: 204
property int height: 40
property color normalColor: Qt.rgba(0, 0, 0, 0.05)
property color cascadeColor: Qt.rgba(0, 0, 0, 0.15)
property int iconSize: 24
property int checkIndicatorIconSize: 24
property D.Palette checkBackgroundColor: D.Palette {
hovered: Qt.rgba(0, 0, 0, 0.1)
normal: Qt.rgba(0, 0, 0, 0.05)
}
property color checkedColor: Qt.rgba(0, 0, 0, 0.15)
}

property QtObject stackView: QtObject {
property int animationDuration: 200
property int animationEasingType: Easing.OutCubic
}

// Indicator
property QtObject busyIndicator: QtObject {
property int size: 16
property int paddingFactor: 16
property D.Palette fillColor: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight)
}
property int animationDuration: 800
property string spinnerSource: "qrc:/dtk/declarative/resources/spinner-blue.webp"
}

property QtObject buttonIndicator: QtObject {
property int size: 16
property int iconSize: 12
property D.Palette background: D.Palette {
normal: Qt.rgba(1, 1, 1, 0.2)
normalDark: ("#ffffff")
}
}

// Bar
property QtObject scrollBar: QtObject {
property int padding: 2
property int width: 4
property int activeWidth: 12
property real hideOpacity: 0.0
property int hidePauseDuration: 450
property int hideDuration: 1500
property int hideWidthDuration: 100

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.3)
normalDark: Qt.rgba(1, 1, 1, 0.3)

hovered: Qt.rgba(0, 0, 0, 0.4)
hoveredDark: Qt.rgba(1, 1, 1, 0.6)

pressed: Qt.rgba(0, 0, 0, 0.4)
pressedDark: Qt.rgba(1, 1, 1, 0.3)
}

property D.Palette outsideBorder: D.Palette {
normal: Qt.rgba(1, 1, 1, 0.1)
normalDark: Qt.rgba(0, 0, 0, 0.1)
}

property D.Palette insideBorder: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.05)
normalDark: Qt.rgba(1, 1, 1, 0.1)
}
}

property QtObject progressBar: QtObject {
property int width: 300
property int height: 36
property int indeterminateProgressBarWidth: 90
property int indeterminateProgressBarAnimationDuration: 2000

property D.Palette shadowColor: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight).opacity(-60)
}

property D.Palette handleGradientColor: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight).hue(-0).saturation(+30).lightness(+30)
}

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.1)
normalDark: Qt.rgba(1, 1, 1, 0.1)
}
}

property QtObject embeddedProgressBar: QtObject {
property int width: 48
property int height: 6
property int contentHeight: 4
property int backgroundRadius: 3
property int contentRadius: 2

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.7)
normalDark: Qt.rgba(1, 1, 1, 0.2)
}

property D.Palette progressBackground: D.Palette {
normal: ("white")
normalDark: Qt.rgba(1, 1, 1, 0.7)
}
}

property QtObject waterProgressBar: QtObject {
property int width: 98
property int height: 98
property string waterFrontImagePath: "qrc:/dtk/declarative/resources/water_front.png"
property string waterBackImagePath: "qrc:/dtk/declarative/resources/water_back.png"

property D.Palette background1: D.Palette {
normal: ("#1f08ff")
}

property D.Palette background2: D.Palette {
normal: ("#50fff7")
}

property D.Palette dropShadow: D.Palette {
normal: Qt.rgba(42 / 255, 154 / 255, 248 / 255, 0.3)
}

property D.Palette popBackground: D.Palette {
normal: Qt.rgba(255, 255, 255, 0.3)
}

property D.Palette textColor: D.Palette {
normal: ("white")
}
}

property QtObject titleBar: QtObject {
property int height: 50
property int iconSize: 32
property int leftMargin: 10
}

// Other
property QtObject slider: QtObject {
property int width: 120
property int height: 60
property int highlightMargin: -4

property QtObject handle: QtObject {
property int width: 20
property int height: 24
}

property QtObject groove: QtObject {
property int width: 100
property int height: 4

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.2)
normalDark: Qt.rgba(1, 1, 1, 0.2)
}
}

property QtObject tick: QtObject {
property int width: 1
property int height: 12
property int radius: 8
property int textMargin: 2
property int hPadding: 10
property int vPadding: 2

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.4)
normalDark: Qt.rgba(1, 1, 1, 0.4)
}
}
}

// Dial
property QtObject dial: QtObject {
property int size: 100
}

// PageIndicator
property QtObject pageIndicator: QtObject {
property int width: 8
property int height: 8
}
}
property D.Palette submenuOpenedItemHigh

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): FlowStyle.qml ends with an incomplete property D.Palette submenuOpenedItemHigh declaration after deleting the remainder of the style object. QML parsing fails, so the style module cannot be loaded and every component importing DS.Style fails to instantiate.

Suggested fix: Restore the deleted FlowStyle contents and complete the submenuOpenedItemHighlight declaration and closing braces.

Comment thread qt6/src/qml/FlowStyle.qml
Comment on lines 822 to +823
// the highlight color of main menu item, when submenu is opened.
property D.Palette submenuOpenedItemHighlight: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.15)
normalDark: Qt.rgba(1, 1, 1, 0.2)
}

property D.Palette itemHighlightShadow: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.2)
normalDark: Qt.rgba(1, 1, 1, 0.1)
}

property D.Palette itemText: D.Palette {
normal: ("black")
normalDark: ("white")
}

property D.Palette separatorText: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.5)
normalDark: Qt.rgba(1, 1, 1, 0.4)
}
}

// Panel
property QtObject highlightPanel: QtObject {
property int width: 180
property int height: 30
property int radius: 8

property D.Palette background: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight)
normalDark: D.DTK.makeColor(D.Color.Highlight)
hovered: D.DTK.makeColor(D.Color.Highlight).lightness(+10)
hoveredDark: D.DTK.makeColor(D.Color.Highlight).lightness(+10)
}
property D.Palette dropShadow: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight).lightness(+20).opacity(-80)
normalDark: D.DTK.makeColor(D.Color.Highlight).lightness(+20).opacity(-80)
}
property D.Palette innerShadow: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight).lightness(-20)
normalDark: D.DTK.makeColor(D.Color.Highlight).lightness(-20)
}
}

property QtObject behindWindowBlur: QtObject {
property color lightColor: Qt.rgba(235 / 255.0, 235 / 255.0, 235 / 255.0, 0.6)
property color lightNoBlurColor: Qt.rgba(235 / 255.0, 235 / 255.0, 235 / 255.0, 1.0)
property color darkColor: "#55000000"
property color darkNoBlurColor: Qt.rgba(35 / 255.0, 35 / 255.0, 35 / 255.0, 1.0)
}

property QtObject arrowRectangleBlur: QtObject {
property int borderWidth: 1
property int roundJoinRadius: 8
property color outBorderColor: Qt.rgba(0, 0, 0, 0.06)
property color darkOutBorderColor: Qt.rgba(0, 0, 0, 0.8)
property color inBorderColor: Qt.rgba(1, 1, 1, 0.1)
property color darkInBorderColor: Qt.rgba(1, 1, 1, 0.8)
property color backgroundColor: behindWindowBlur.lightColor
property color darkBackgroundColor: behindWindowBlur.darkColor
property color backgroundNoBlurColor: behindWindowBlur.lightNoBlurColor
property color darkBackgroundNoBlurColor: behindWindowBlur.darkNoBlurColor
property color shadowColor: Qt.rgba(0, 0, 0, 0.2)
property color darkShadowColor: Qt.rgba(0, 0, 0, 0.2)
}

property QtObject arrowListView: QtObject {
property int width: 180
property size stepButtonSize: Qt.size(16, 16)
property size stepButtonIconSize: Qt.size(12, 12)
property int maxVisibleItems: 16
property int itemHeight: 30
property string upButtonIconName: "arrow_ordinary_up"
property string downButtonIconName: "arrow_ordinary_down"
}

property QtObject itemDelegate: QtObject {
property int width: 204
property int height: 40
property color normalColor: Qt.rgba(0, 0, 0, 0.05)
property color cascadeColor: Qt.rgba(0, 0, 0, 0.15)
property int iconSize: 24
property int checkIndicatorIconSize: 24
property D.Palette checkBackgroundColor: D.Palette {
hovered: Qt.rgba(0, 0, 0, 0.1)
normal: Qt.rgba(0, 0, 0, 0.05)
}
property color checkedColor: Qt.rgba(0, 0, 0, 0.15)
}

property QtObject stackView: QtObject {
property int animationDuration: 200
property int animationEasingType: Easing.OutCubic
}

// Indicator
property QtObject busyIndicator: QtObject {
property int size: 16
property int paddingFactor: 16
property D.Palette fillColor: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight)
}
property int animationDuration: 800
property string spinnerSource: "qrc:/dtk/declarative/resources/spinner-blue.webp"
}

property QtObject buttonIndicator: QtObject {
property int size: 16
property int iconSize: 12
property D.Palette background: D.Palette {
normal: Qt.rgba(1, 1, 1, 0.2)
normalDark: ("#ffffff")
}
}

// Bar
property QtObject scrollBar: QtObject {
property int padding: 2
property int width: 4
property int activeWidth: 12
property real hideOpacity: 0.0
property int hidePauseDuration: 450
property int hideDuration: 1500
property int hideWidthDuration: 100

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.3)
normalDark: Qt.rgba(1, 1, 1, 0.3)

hovered: Qt.rgba(0, 0, 0, 0.4)
hoveredDark: Qt.rgba(1, 1, 1, 0.6)

pressed: Qt.rgba(0, 0, 0, 0.4)
pressedDark: Qt.rgba(1, 1, 1, 0.3)
}

property D.Palette outsideBorder: D.Palette {
normal: Qt.rgba(1, 1, 1, 0.1)
normalDark: Qt.rgba(0, 0, 0, 0.1)
}

property D.Palette insideBorder: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.05)
normalDark: Qt.rgba(1, 1, 1, 0.1)
}
}

property QtObject progressBar: QtObject {
property int width: 300
property int height: 36
property int indeterminateProgressBarWidth: 90
property int indeterminateProgressBarAnimationDuration: 2000

property D.Palette shadowColor: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight).opacity(-60)
}

property D.Palette handleGradientColor: D.Palette {
normal: D.DTK.makeColor(D.Color.Highlight).hue(-0).saturation(+30).lightness(+30)
}

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.1)
normalDark: Qt.rgba(1, 1, 1, 0.1)
}
}

property QtObject embeddedProgressBar: QtObject {
property int width: 48
property int height: 6
property int contentHeight: 4
property int backgroundRadius: 3
property int contentRadius: 2

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.7)
normalDark: Qt.rgba(1, 1, 1, 0.2)
}

property D.Palette progressBackground: D.Palette {
normal: ("white")
normalDark: Qt.rgba(1, 1, 1, 0.7)
}
}

property QtObject waterProgressBar: QtObject {
property int width: 98
property int height: 98
property string waterFrontImagePath: "qrc:/dtk/declarative/resources/water_front.png"
property string waterBackImagePath: "qrc:/dtk/declarative/resources/water_back.png"

property D.Palette background1: D.Palette {
normal: ("#1f08ff")
}

property D.Palette background2: D.Palette {
normal: ("#50fff7")
}

property D.Palette dropShadow: D.Palette {
normal: Qt.rgba(42 / 255, 154 / 255, 248 / 255, 0.3)
}

property D.Palette popBackground: D.Palette {
normal: Qt.rgba(255, 255, 255, 0.3)
}

property D.Palette textColor: D.Palette {
normal: ("white")
}
}

property QtObject titleBar: QtObject {
property int height: 50
property int iconSize: 32
property int leftMargin: 10
}

// Other
property QtObject slider: QtObject {
property int width: 120
property int height: 60
property int highlightMargin: -4

property QtObject handle: QtObject {
property int width: 20
property int height: 24
}

property QtObject groove: QtObject {
property int width: 100
property int height: 4

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.2)
normalDark: Qt.rgba(1, 1, 1, 0.2)
}
}

property QtObject tick: QtObject {
property int width: 1
property int height: 12
property int radius: 8
property int textMargin: 2
property int hPadding: 10
property int vPadding: 2

property D.Palette background: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.4)
normalDark: Qt.rgba(1, 1, 1, 0.4)
}
}
}

// Dial
property QtObject dial: QtObject {
property int size: 100
}

// PageIndicator
property QtObject pageIndicator: QtObject {
property int width: 8
property int height: 8
}
}
property D.Palette submenuOpenedItemHigh

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (broader_impact): The change removes the existing style objects after the toolButton section, including highlightPanel, behindWindowBlur, arrowRectangleBlur, itemDelegate, scrollBar, progressBar, titleBar, and related properties that remain referenced by QML components. Those references resolve to undefined style objects at runtime even if the truncated FlowStyle declaration is repaired.

Triggers: When any component using one of the removed DS.Style properties is loaded.

Suggested fix: Keep all unrelated FlowStyle properties and only add the new toolButton properties.

visible: control.checked
z: D.DTK.AboveOrder
cornerRadius: buttonPanel.radius
shadowColor: control.D.ColorSelector.checkedShadow

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): D.ColorSelector exposes palette colors using the ...Color naming convention, but the checked shadow is read as control.D.ColorSelector.checkedShadow. That attached property is undefined, so the checked chip's shadowColor does not receive the configured palette color and can produce an invalid binding/runtime warning.

Triggers: When a ToolButton is checked and the checked shadow is evaluated.

Suggested fix: Use the ColorSelector-exposed checked shadow color property, such as control.D.ColorSelector.checkedShadowColor, or bind directly to the checkedShadow palette through a supported selector API.

@hudeng-go

Copy link
Copy Markdown

/ok-to-test

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