Skip to content

fix(ListView): use themed disabled background instead of SystemColors.ControlBrush#1554

Merged
pomianowski merged 1 commit intolepoco:mainfrom
apachezy:fix/ListView-Disabled-Background
Oct 28, 2025
Merged

fix(ListView): use themed disabled background instead of SystemColors.ControlBrush#1554
pomianowski merged 1 commit intolepoco:mainfrom
apachezy:fix/ListView-Disabled-Background

Conversation

@apachezy
Copy link
Copy Markdown
Contributor

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

Problem The ListView with GridView template (GridViewTemplate) sets the disabled state background to SystemColors.ControlBrush, bypassing Wpf.Ui’s theme resource keys. In dark themes this produces a jarring white block while adjacent controls use dark palette values, breaking visual consistency.

Screenshot (Dark Theme):
屏幕截图 2025-10-28 004151

Screenshot (Light Theme):
屏幕截图 2025-10-28 004205

Changes made:

Updated the disabled state background in ListView's GridViewTemplate from SystemColors.ControlBrushKey to ControlFillColorDisabledBrush.

What is the new behavior?

Effects Disabled ListView with GridView now blends into the themed surface (light: subtle muted fill; dark: appropriate subdued dark tone) instead of defaulting to pure white.

Screenshot (Dark Theme):
屏幕截图 2025-10-28 004754

Screenshot (Light Theme):
屏幕截图 2025-10-28 004809

Other information

I believe a better approach would be to remove this trigger and not alter the background color for the disabled state at all. However, for now, this fix is scoped only to replacing the brush.

@apachezy apachezy requested a review from pomianowski as a code owner October 27, 2025 17:42
@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. styles Topic is related to styles PR Pull request release labels Oct 27, 2025
@apachezy
Copy link
Copy Markdown
Contributor Author

I will close this PR due to a type conversion error.

@apachezy apachezy closed this Oct 27, 2025
@apachezy
Copy link
Copy Markdown
Contributor Author

Reopening this PR as the issue was unrelated.

After further investigation, I've confirmed that the exception in my project was caused by an unrelated issue. This PR, which applies the themed disabled background, is correct and does not introduce any regressions.

The fix here is still valid and improves theme consistency. It is ready for review.

@apachezy apachezy reopened this Oct 27, 2025
@pomianowski pomianowski changed the title Fix(ListView): use themed disabled background instead of SystemColors.ControlBrush fix(ListView): use themed disabled background instead of SystemColors.ControlBrush Oct 28, 2025
@pomianowski pomianowski merged commit a6dad2e into lepoco:main Oct 28, 2025
4 checks passed
@apachezy apachezy deleted the fix/ListView-Disabled-Background branch October 28, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. PR Pull request release styles Topic is related to styles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants