winutil icon indicating copy to clipboard operation
winutil copied to clipboard

Fix DNS dropdown styling: scope leaked ToggleButton style, theme the popup list

Open YayoRazo opened this issue 4 months ago • 1 comments

Type of Change

  • [x] Bug fix
  • [ ] New feature
  • [ ] Documentation update
  • [ ] Refactor
  • [x] UI/UX improvement

Description

Three compounding issues on the DNS dropdown (WPFchangedns), all traced back to the same control:

  1. Cramped closed-box text. An implicit, unscoped <Style TargetType="{x:Type ToggleButton}"> (meant only for the top-bar tab buttons - the file even had a stale comment saying x:Key="TabToggleButton", but the actual x:Key attribute was missing) was leaking into the ComboBox's internal ToggleButton template part, stacking tab-button-sized borders/margins onto a 25px-tall combo box. Fixed by actually giving it the x:Key the comment already claimed, and referencing it explicitly from the 6 tab buttons that want it.
  2. White-on-white dropdown list. No ComboBoxItem style existed anywhere, so every item in the open dropdown fell back to WPF's default white background / black text regardless of theme. Added a themed ComboBoxItem style (background/foreground/hover/selected), plus an explicit ContentTemplate so item text isn't silently repainted by the app's own global implicit TextBlock style (which sets an unrelated label color).
  3. Closed-box background falling back to native chrome. Once decoupled from the leaked tab-button style, the ComboBox's internal ToggleButton had no template of its own and fell back to the OS-default beveled/light ToggleButton chrome, which doesn't cleanly respect Background="Transparent". Gave it a minimal dedicated template (just a transparent-passthrough Border + ContentPresenter) so the surrounding themed OuterBorder shows through correctly.

Verification

  • .\Compile.ps1 succeeds.
  • Full Pester suite: 397/398 passing (the 1 failure is pre-existing on main, unrelated - see PR #4834).
  • Manually opened the dropdown in dark theme and confirmed: closed-box text has proper padding, the open list has a themed dark background with readable text in every state (normal/hover/selected), and the 6 tab buttons still look unchanged.

Issue related to PR

  • Resolves #4832

YayoRazo avatar Jul 13 '26 04:07 YayoRazo

Ran pester suite locally and produced the same results. Also verified UI changes on both themes.

image image

mewclouds avatar Jul 13 '26 07:07 mewclouds