Skip to content

Fix subtitle editor focus border not following system accent color#11576

Merged
niksedk merged 1 commit into
SubtitleEdit:mainfrom
mjuhasz:fix/edit-box-focus-accent-color
Jun 13, 2026
Merged

Fix subtitle editor focus border not following system accent color#11576
niksedk merged 1 commit into
SubtitleEdit:mainfrom
mjuhasz:fix/edit-box-focus-accent-color

Conversation

@mjuhasz

@mjuhasz mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

The focused border brush for the AvaloniaEdit-based subtitle text box was hardcoded to Colors.DodgerBlue in both MakeTextEditor and MakeOriginalTextEditor. Every other focusable control in the app relies on Avalonia's Fluent theme to supply the system accent color automatically, so users who changed their accent saw a jarring blue border that stood out from the rest of the UI.

Root cause

Commit 39068ba (today) set FocusAdorner = null on the TextEditor and its inner TextArea in order to suppress Avalonia's default focus adorner and let the wrapper Border render the focus ring instead. Before that change the FocusAdorner was drawn by the Fluent theme using the system accent color and was the primary visible focus cue. Removing it left the hardcoded DodgerBlue Border as the only indicator, which does not follow the accent.

Fix

Add UiUtil.GetAccentBrush(), which resolves SystemAccentColor from the Fluent theme resource dictionary at call time (same Application.Current + ActualThemeVariant pattern used by GetBorderBrush). Replace both hardcoded SolidColorBrush(Colors.DodgerBlue) call sites with UiUtil.GetAccentBrush(). DodgerBlue is retained as the fallback for the rare case where the theme resource is unavailable during startup.

Before -> After

before after

The focused border brush for the AvaloniaEdit-based subtitle text box was
hardcoded to Colors.DodgerBlue in both MakeTextEditor and
MakeOriginalTextEditor. Every other focusable control in the app relies on
Avalonia's Fluent theme to supply the system accent color automatically, so
users who changed their accent saw a jarring blue border that stood out from
the rest of the UI.

Root cause: commit 39068ba (today) set FocusAdorner = null on the TextEditor
and its inner TextArea in order to suppress Avalonia's default focus adorner and
let the wrapper Border render the focus ring instead. Before that change the
FocusAdorner was drawn by the Fluent theme using the system accent color and was
the primary visible focus cue. Removing it left the hardcoded DodgerBlue Border
as the only indicator, which does not follow the accent.

Fix: add UiUtil.GetAccentBrush(), which resolves SystemAccentColor from the
Fluent theme resource dictionary at call time (same Application.Current +
ActualThemeVariant pattern used by GetBorderBrush). Replace both hardcoded
SolidColorBrush(Colors.DodgerBlue) call sites with UiUtil.GetAccentBrush().
DodgerBlue is retained as the fallback for the rare case where the theme
resource is unavailable during startup.
@niksedk niksedk merged commit 2202542 into SubtitleEdit:main Jun 13, 2026
2 checks passed
@mjuhasz mjuhasz deleted the fix/edit-box-focus-accent-color branch June 13, 2026 19:47
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