Improve font selection controls#10752
Open
Monstercate wants to merge 1 commit intoSubtitleEdit:mainfrom
Open
Conversation
Member
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves font selection UX across the UI by replacing fixed font ComboBoxes with searchable AutoCompleteBox controls, adding localized font-name mapping for font resolution, and enhancing dropdown/preview behavior (stable widths, wheel scrolling, hover preview).
Changes:
- Introduces global dropdown-width stabilization and wheel-scrolling support for font dropdown items.
- Updates settings and ASS/SSA style editors to use searchable font pickers (with hover-based preview in ASS/SSA editors).
- Expands font-name mapping to include multiple Win32 localized family names (and a typographic-name fallback) for more reliable font resolution.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ui/Program.cs | Registers the new dropdown-width stabilization behavior at app startup. |
| src/ui/Logic/UiUtil.cs | Adds dropdown width stabilization logic and pointer-wheel scrolling helper for dropdown items. |
| src/ui/Logic/FontHelper.cs | Enhances libass-to-Skia font name mapping using multiple localized Win32 family names. |
| src/ui/Features/Options/Settings/SettingsPage.cs | Replaces font ComboBoxes with searchable AutoCompleteBox controls in settings. |
| src/ui/Features/Options/Settings/CustomContinuationStyleViewModel.cs | Replaces a malformed ellipsis glyph with the correct Unicode ellipsis. |
| src/ui/Features/Files/ImportPlainText/PlainTextSplitter.cs | Updates sentence break detection to recognize Unicode ellipsis. |
| src/ui/Features/Assa/AssaStylesWindow.cs | Replaces ASS/SSA style font selector with searchable control + hover preview behavior and preview layout adjustments. |
| src/ui/Features/Assa/AssaStylesViewModel.cs | Adds hover-preview font handling and ensures preview updates immediately on initialization. |
| src/ui/Features/Assa/AssaSingleStyleWindow.cs | Replaces single-style font selector with searchable control + hover preview behavior and preview layout adjustments. |
| src/ui/Features/Assa/AssaSingleStyleViewModel.cs | Adds hover-preview font handling and generates preview bitmaps for the single-style editor. |
Comment on lines
+94
to
+114
| var width = CalculateDropDownWidth(owner, items); | ||
| popup.PlacementTarget = owner; | ||
| popup.Placement = PlacementMode.BottomEdgeAlignedLeft; | ||
| popup.HorizontalOffset = 0; | ||
| popup.Width = width; | ||
| popup.MinWidth = width; | ||
| popup.MaxWidth = width; | ||
|
|
||
| if (popup.Child is Control popupChild) | ||
| { | ||
| popupChild.Width = width; | ||
| popupChild.MinWidth = width; | ||
| popupChild.MaxWidth = width; | ||
| } | ||
|
|
||
| if (remainingAttempts > 0) | ||
| { | ||
| DispatcherTimer.RunOnce( | ||
| () => TryStabilizeDropDownWidth(owner, items, remainingAttempts - 1), | ||
| TimeSpan.FromMilliseconds(25)); | ||
| } |
Comment on lines
+86
to
91
| if (_previewFontName != null) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| _timerUpdatePreview.Stop(); |
Comment on lines
+930
to
+952
| void OpenDropDown() | ||
| { | ||
| if (!userActivated) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| Dispatcher.UIThread.Post(() => | ||
| { | ||
| box.IsDropDownOpen = true; | ||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| }, DispatcherPriority.Background); | ||
| DispatcherTimer.RunOnce(() => | ||
| { | ||
| box.IsDropDownOpen = true; | ||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| }, TimeSpan.FromMilliseconds(10)); | ||
| DispatcherTimer.RunOnce(() => | ||
| { | ||
| box.IsDropDownOpen = true; | ||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| }, TimeSpan.FromMilliseconds(50)); |
Comment on lines
+555
to
+577
| void OpenDropDown() | ||
| { | ||
| if (!userActivated) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| Dispatcher.UIThread.Post(() => | ||
| { | ||
| box.IsDropDownOpen = true; | ||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| }, DispatcherPriority.Background); | ||
| DispatcherTimer.RunOnce(() => | ||
| { | ||
| box.IsDropDownOpen = true; | ||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| }, TimeSpan.FromMilliseconds(10)); | ||
| DispatcherTimer.RunOnce(() => | ||
| { | ||
| box.IsDropDownOpen = true; | ||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| }, TimeSpan.FromMilliseconds(50)); |
Comment on lines
+229
to
+251
| void OpenDropDown() | ||
| { | ||
| if (!userActivated) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| Dispatcher.UIThread.Post(() => | ||
| { | ||
| box.IsDropDownOpen = true; | ||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| }, DispatcherPriority.Background); | ||
| DispatcherTimer.RunOnce(() => | ||
| { | ||
| box.IsDropDownOpen = true; | ||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| }, TimeSpan.FromMilliseconds(10)); | ||
| DispatcherTimer.RunOnce(() => | ||
| { | ||
| box.IsDropDownOpen = true; | ||
| UiUtil.StabilizeDropDownWidth(box, box.ItemsSource); | ||
| }, TimeSpan.FromMilliseconds(50)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Testing
Built successfully with: