fix: Remove hardcoded colors in disk health detection dialog for theme compatibility#184
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:release/1071from Nov 24, 2025
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors DiskHealthDetectionDialog to rely on theme-driven palettes instead of hardcoded colors while keeping explicit semantic colors only for health state indicators and table delegate rendering. Sequence diagram for theme-driven text color in DiskHealthDetectionDelegatesequenceDiagram
actor "User" as User
participant "Application" as App
participant "DiskHealthDetectionDialog" as Dialog
participant "QTableView" as TableView
participant "DiskHealthDetectionDelegate" as Delegate
participant "QStyle" as Style
"User" ->> "App" : "Open disk health detection dialog"
"App" ->> "Dialog" : "create() and initUI()"
"Dialog" ->> "TableView" : "setItemDelegate(Delegate)"
"User" ->> "System" : "Change theme (light/dark)"
"App" ->> "TableView" : "update() triggered by theme change"
"TableView" ->> "Delegate" : "paint(option, index) for each cell"
"Delegate" ->> "option.palette" : "color(QPalette::Text)"
"option.palette" -->> "Delegate" : "theme-derived text color"
"Delegate" ->> "Style" : "drawControl() with palette text color"
"Style" -->> "TableView" : "cell rendered with correct text color"
"TableView" -->> "User" : "SMART attributes text matches current theme"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Since the delegate no longer has its text color set from the dialog, consider removing the setTextColor API and any related state from DiskHealthDetectionDelegate if it has become unused to keep the delegate interface minimal and avoid dead code.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since the delegate no longer has its text color set from the dialog, consider removing the setTextColor API and any related state from DiskHealthDetectionDelegate if it has become unused to keep the delegate interface minimal and avoid dead code.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…e compatibility - Remove hardcoded DPalette definitions (palette1-6) in DiskHealthDetectionDialog - Remove all setPalette() calls that prevented theme color following - Use option.palette.color(QPalette::Text) in DiskHealthDetectionDelegate for dynamic theme color - Preserve semantic colors for health status indicators (good/damaged/unknown) Log: Fix disk health panel font color not following dark mode theme Bug: https://pms.uniontech.com/bug-view-341105.html
deepin pr auto review我来对这段代码的变更进行审查:
建议:
总的来说,这是一个很好的重构,提高了代码的可维护性和主题适配性。 |
max-lvs
approved these changes
Nov 24, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: itsXuSt, max-lvs 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 |
Contributor
Author
|
/merge |
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.
Log: Fix disk health panel font color not following dark mode theme
Bug: https://pms.uniontech.com/bug-view-341105.html
Summary by Sourcery
Align disk health detection dialog colors with the active application theme to fix dark mode font visibility issues.
Bug Fixes:
Enhancements: