File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
33using System . IO ;
4+ using System . Linq ;
45using System . Text . Json ;
56using System . Text . Json . Serialization ;
67using System . Threading . Tasks ;
78using Avalonia . Collections ;
9+ using Avalonia . Media ;
810using CommunityToolkit . Mvvm . ComponentModel ;
911
1012namespace SourceGit . ViewModels
@@ -61,6 +63,8 @@ public string ThemeOverrides
6163 }
6264 }
6365
66+ public IEnumerable < string > Fonts => FontManager . Current . SystemFonts . Select ( f => f . FamilyNames . FirstOrDefault ( ) ) ;
67+
6468 public string DefaultFontFamily
6569 {
6670 get => _defaultFontFamily ;
Original file line number Diff line number Diff line change 210210 Text =" {DynamicResource Text.Preferences.Appearance.DefaultFont}"
211211 HorizontalAlignment =" Right"
212212 Margin =" 0,0,16,0" />
213- <TextBox Grid.Row=" 1" Grid.Column=" 1"
214- Height =" 28"
215- CornerRadius =" 3"
216- Text =" {Binding DefaultFontFamily, Mode=TwoWay}" />
213+ <ComboBox Grid.Row=" 1" Grid.Column=" 1"
214+ Height =" 28"
215+ HorizontalAlignment =" Stretch"
216+ Padding =" 8,0"
217+ CornerRadius =" 3"
218+ ItemsSource =" {Binding Fonts, Mode=OneWay}"
219+ SelectedItem =" {Binding DefaultFontFamily, Mode=TwoWay}" />
217220
218221 <TextBlock Grid.Row=" 2" Grid.Column=" 0"
219222 Text =" {DynamicResource Text.Preferences.Appearance.MonospaceFont}"
220223 HorizontalAlignment =" Right"
221224 Margin =" 0,0,16,0" />
222- <TextBox Grid.Row=" 2" Grid.Column=" 1"
225+ <ComboBox Grid.Row=" 2" Grid.Column=" 1"
223226 Height =" 28"
227+ HorizontalAlignment =" Stretch"
228+ Padding =" 8,0"
224229 CornerRadius =" 3"
225- Text =" {Binding MonospaceFontFamily, Mode=TwoWay}" />
230+ ItemsSource =" {Binding Fonts, Mode=OneWay}"
231+ SelectedItem =" {Binding MonospaceFontFamily, Mode=TwoWay}" />
226232
227233 <TextBlock Grid.Row=" 3" Grid.Column=" 0"
228234 Text =" {DynamicResource Text.Preferences.Appearance.FontSize}"
You can’t perform that action at this time.
0 commit comments