feat: add theme-aware progress bar background color#505
Merged
Conversation
deepin-ci-robot
added a commit
to linuxdeepin/dtk6declarative
that referenced
this pull request
Jul 23, 2025
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#505
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideThis PR enhances the progress bar’s background styling by defining theme-aware palettes in FlowStyle.qml and updating ProgressBarPanel.qml to use dynamic theme bindings via the DTK ColorSelector. Class diagram for theme-aware progress bar background colorclassDiagram
class FlowStyle {
+D.Palette progressBar.background : D.Palette
+D.Palette embeddedProgressBar.background : D.Palette
}
class D.Palette {
+normal : color
+normalDark : color
}
class ProgressBarPanel {
+backgroundColor : Palette (from DS.Style.progressBar.background)
}
class ColorSelector {
+backgroundColor
}
FlowStyle --> D.Palette : uses
ProgressBarPanel --> ColorSelector : uses
ProgressBarPanel --> FlowStyle : references DS.Style.progressBar.background
ColorSelector --> FlowStyle : gets backgroundColor
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @18202781743 - I've reviewed your changes - here's some feedback:
- The two ‘background’ palette definitions in FlowStyle.qml look nearly identical—consider consolidating them into a single style entry to avoid duplication.
- Rather than hard-coding Qt.rgba values, derive your light/dark variants from an existing DTK color role (e.g. D.Color.Background) with color adjustments for better theme consistency.
- In ProgressBarPanel.qml you can simplify the Rectangle color binding by using DS.Style.progressBar.background directly in ColorSelector and removing the extra backgroundColor alias.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The two ‘background’ palette definitions in FlowStyle.qml look nearly identical—consider consolidating them into a single style entry to avoid duplication.
- Rather than hard-coding Qt.rgba values, derive your light/dark variants from an existing DTK color role (e.g. D.Color.Background) with color adjustments for better theme consistency.
- In ProgressBarPanel.qml you can simplify the Rectangle color binding by using DS.Style.progressBar.background directly in ColorSelector and removing the extra backgroundColor alias.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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
deepin-ci-robot
added a commit
to linuxdeepin/dtk6declarative
that referenced
this pull request
Jul 23, 2025
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#505
mhduiy
approved these changes
Jul 24, 2025
18202781743
pushed a commit
to linuxdeepin/dtk6declarative
that referenced
this pull request
Jul 24, 2025
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#505
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: 添加主题感知的进度条背景色
这些更改确保进度条背景色能正确适配亮色和暗色主题,提升不同主题设置下的视
觉一致性。该实现通过使用DTK颜色系统提供了更好的主题支持。
pms: BUG-320479
Summary by Sourcery
Add theme-aware background color support to progress bars by defining a background property in FlowStyle.qml, specifying distinct RGBA values for light and dark themes, and applying it in ProgressBarPanel.qml with ColorSelector for dynamic theme switching.
New Features:
Enhancements: