Skip to content

Commit eaf6a79

Browse files
committed
feat: add theme-aware progress bar background color
1. Added background color property to progressBar style in FlowStyle.qml 2. Modified ProgressBarPanel.qml to use theme-aware background color 3. Implemented separate colors for normal and dark themes (rgba values) 4. Uses ColorSelector for dynamic theme switching support The changes ensure progress bar background colors properly adapt to both light and dark themes, improving visual consistency across different theme settings. The implementation provides better theming support by using the DTK color system. feat: 添加主题感知的进度条背景色 1. 在FlowStyle.qml中为progressBar样式添加背景色属性 2. 修改ProgressBarPanel.qml以使用主题感知的背景色 3. 为普通和暗色主题实现不同的颜色值(rgba) 4. 使用ColorSelector支持动态主题切换 这些更改确保进度条背景色能正确适配亮色和暗色主题,提升不同主题设置下的视 觉一致性。该实现通过使用DTK颜色系统提供了更好的主题支持。 pms: BUG-320479
1 parent 33b41e4 commit eaf6a79

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

qt6/src/qml/FlowStyle.qml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ QtObject {
504504
}
505505

506506
property D.Palette shadowInner2: D.Palette {
507+
normal: Qt.rgba(0, 0, 0, 0.1)
507508
normalDark: Qt.rgba(1, 1, 1, 0.1)
508509
}
509510

@@ -850,6 +851,11 @@ QtObject {
850851
property D.Palette handleGradientColor: D.Palette {
851852
normal: D.DTK.makeColor(D.Color.Highlight).hue(-0).saturation(+30).lightness(+30)
852853
}
854+
855+
property D.Palette background: D.Palette {
856+
normal: Qt.rgba(0, 0, 0, 0.1)
857+
normalDark: Qt.rgba(1, 1, 1, 0.1)
858+
}
853859
}
854860

855861
property QtObject embeddedProgressBar: QtObject {
@@ -861,7 +867,7 @@ QtObject {
861867

862868
property D.Palette background: D.Palette {
863869
normal: Qt.rgba(0, 0, 0, 0.7)
864-
normalDark: Qt.rgba(0, 0, 0, 0.2)
870+
normalDark: Qt.rgba(1, 1, 1, 0.2)
865871
}
866872

867873
property D.Palette progressBackground: D.Palette {

qt6/src/qml/private/ProgressBarPanel.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ Item {
2323
Component {
2424
id: _normalTextComponent
2525
Rectangle {
26+
property Palette backgroundColor: DS.Style.progressBar.background
2627
radius: DS.Style.control.radius
27-
color: Qt.rgba(0, 0, 0, 0.1);
28+
color: ColorSelector.backgroundColor
2829
}
2930
}
3031
}

0 commit comments

Comments
 (0)