Skip to content

Refine DataGrid selection focus styling#11561

Merged
niksedk merged 1 commit into
SubtitleEdit:mainfrom
mjuhasz:tweak/refine-datagrid-selection-focus
Jun 12, 2026
Merged

Refine DataGrid selection focus styling#11561
niksedk merged 1 commit into
SubtitleEdit:mainfrom
mjuhasz:tweak/refine-datagrid-selection-focus

Conversation

@mjuhasz

@mjuhasz mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Selected DataGrid rows looked the same regardless of whether the grid had focus, making it hard to tell at a glance which panel was active.

Changes

  • Show full-strength row highlight only while the DataGrid has focus.
  • Dim the selection to a faint opacity when focus moves away.

I also noticed a frame thickness inconsistency which I fixed separately, here: #11562

grid.focus.mov

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.
@niksedk niksedk merged commit 1229a3a into SubtitleEdit:main Jun 12, 2026
2 checks passed
@mjuhasz mjuhasz deleted the tweak/refine-datagrid-selection-focus branch June 12, 2026 18:04
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