winutil
winutil copied to clipboard
Fix DNS dropdown styling: scope leaked ToggleButton style, theme the popup list
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:
- 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 sayingx:Key="TabToggleButton", but the actualx:Keyattribute was missing) was leaking into the ComboBox's internalToggleButtontemplate part, stacking tab-button-sized borders/margins onto a 25px-tall combo box. Fixed by actually giving it thex:Keythe comment already claimed, and referencing it explicitly from the 6 tab buttons that want it. - White-on-white dropdown list. No
ComboBoxItemstyle existed anywhere, so every item in the open dropdown fell back to WPF's default white background / black text regardless of theme. Added a themedComboBoxItemstyle (background/foreground/hover/selected), plus an explicitContentTemplateso item text isn't silently repainted by the app's own global implicitTextBlockstyle (which sets an unrelated label color). - Closed-box background falling back to native chrome. Once decoupled from the leaked tab-button style, the ComboBox's internal
ToggleButtonhad no template of its own and fell back to the OS-default beveled/lightToggleButtonchrome, which doesn't cleanly respectBackground="Transparent". Gave it a minimal dedicated template (just a transparent-passthroughBorder+ContentPresenter) so the surrounding themedOuterBordershows through correctly.
Verification
.\Compile.ps1succeeds.- 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
Ran pester suite locally and produced the same results. Also verified UI changes on both themes.