fix(text): group controls and filter font families

Put size and color on one row, place emphasis labels before their toggles, and split the remaining font families into handwriting, symbols, and international groups while omitting legacy dingbat fonts. Text-layer properties follow the existing hierarchical layout and palette conventions.
This commit is contained in:
2026-11-04 17:17:57 -08:00
parent 5f7bcc2425
commit d195c29f79
3 changed files with 115 additions and 31 deletions
+18 -2
View File
@@ -3,6 +3,7 @@ using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using Microsoft.Data.Sqlite;
using Xunit;
using ytLive.Controls;
@@ -51,6 +52,7 @@ public sealed class TextLayerDropdownTests
var color = (ComboBox)panel.FindName("TextLayerColorPicker")!;
var horizontal = (ComboBox)panel.FindName("TextLayerHorizontalAlignmentPicker")!;
var vertical = (ComboBox)panel.FindName("TextLayerVerticalAlignmentPicker")!;
var boldToggle = (ToggleButton)panel.FindName("TextBoldToggle")!;
Assert.Equal("Sans Serif", fontType.SelectedItem);
Assert.Equal("Sans Serif", fontType.Text);
@@ -67,10 +69,24 @@ public sealed class TextLayerDropdownTests
Assert.Same(Application.Current.Resources["YtComboBox"], color.Style);
Assert.Same(panel.Resources["BorderColorTemplates"], color.ItemTemplateSelector);
Assert.Equal(10, ((FrameworkElement)fontType.Parent).Margin.Left);
Assert.Equal(10, ((FrameworkElement)color.Parent).Margin.Left);
Assert.Same(size.Parent, colorField.Parent);
Assert.Same(size.Parent, color.Parent);
Assert.Equal(10, ((FrameworkElement)panel.FindName("TextTypographyOptions")!).Margin.Left);
Assert.Equal(10, ((FrameworkElement)panel.FindName("TextEmphasisOptions")!).Margin.Left);
Assert.Equal(10, ((FrameworkElement)horizontal.Parent).Margin.Left);
Assert.Equal(10, ((FrameworkElement)vertical.Parent).Margin.Left);
var boldRow = (DockPanel)boldToggle.Parent;
Assert.True(boldRow.Children.IndexOf(boldRow.Children[0]) < boldRow.Children.IndexOf(boldToggle));
Assert.Equal("Bold", ((TextBlock)boldRow.Children[0]).Text);
fontType.SelectedItem = "Symbols";
window.UpdateLayout();
Assert.DoesNotContain(vm.TextFontFamilies, item => item is "Webdings" or "Wingdings" or "Wingdings 2" or "Wingdings 3");
Assert.Equal("Segoe UI", source.TextFontFamily);
fontType.SelectedItem = "Sans Serif";
window.UpdateLayout();
Assert.Equal("Segoe UI", font.SelectedItem);
fontType.SelectedItem = "Serif";
window.UpdateLayout();