Skip to content

Align list box hover and unfocused selection styling with DataGrid#11566

Merged
niksedk merged 2 commits into
SubtitleEdit:mainfrom
mjuhasz:tweak/align-listbox-selection-focus
Jun 12, 2026
Merged

Align list box hover and unfocused selection styling with DataGrid#11566
niksedk merged 2 commits into
SubtitleEdit:mainfrom
mjuhasz:tweak/align-listbox-selection-focus

Conversation

@mjuhasz

@mjuhasz mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

This updates the shared Avalonia ListBoxItem styling to match the selection-focus behavior I recently applied to DataGrid in #11562

Caution

Merge #11562 first - this branch and the tweaks are on top of data grid tweaks.

Changes

  • Remove the grey background on unselected list box item hover
  • Keep selected list box items visually strong only while the owning list box has focus
  • Render unfocused selected list box items with a lighter accent background
  • Keep selected-hover state from becoming stronger than the base selected state

Scope

This affects shared ListBoxItem visuals across the app, including windows such as:

  • spell check and OCR suggestion lists
  • plugin and settings lists
  • word list editors
  • subtitle format/model pickers
  • other standard ListBox-based pickers and history views

No behavior, selection logic, bindings, or non-ListBox controls were changed.

Listbox.mov

Miklos Juhasz added 2 commits June 12, 2026 12:47
Override the shared DataGrid row resources so hovered rows no longer pick up a separate hover fill and unfocused selected rows render with a much fainter opacity.

Keep the selected-row highlight strong only while the owning grid has focus by targeting the upstream BackgroundRectangle via DataGrid:focus-within selectors.

Trim the custom row selectors down to the minimum needed on top of Avalonia's Fluent DataGrid theme instead of duplicating upstream selected-row behavior.
Add shared ListBoxItem theme overrides so list boxes follow the same selection-focus behavior as the recent DataGrid styling update.

Remove the default grey hover fill for unselected list items, keep selected rows visually strong only while the owning ListBox has focus, and render unfocused selected items with a lighter accent brush.

Scope is limited to shared ListBox visuals in Styles.axaml; no selection behavior, bindings, or non-ListBox controls are changed.
@niksedk niksedk merged commit 6332d60 into SubtitleEdit:main Jun 12, 2026
2 checks passed
@mjuhasz mjuhasz deleted the tweak/align-listbox-selection-focus branch June 12, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants