Skip to content

Commit 28344a7

Browse files
committed
ux: remove Use monospace font only in text editor option in Preferences and make it default (also the only)
Signed-off-by: leo <longshuang@msn.cn>
1 parent cd659f9 commit 28344a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+202
-276
lines changed

src/App.axaml.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public static void SetTheme(string theme, string themeOverridesFile)
262262
}
263263
}
264264

265-
public static void SetFonts(string defaultFont, string monospaceFont, bool onlyUseMonospaceFontInEditor)
265+
public static void SetFonts(string defaultFont, string monospaceFont)
266266
{
267267
if (Current is not App app)
268268
return;
@@ -296,19 +296,6 @@ public static void SetFonts(string defaultFont, string monospaceFont, bool onlyU
296296
resDic.Add("Fonts.Monospace", new FontFamily(monospaceFont));
297297
}
298298

299-
if (onlyUseMonospaceFontInEditor)
300-
{
301-
if (string.IsNullOrEmpty(defaultFont))
302-
resDic.Add("Fonts.Primary", new FontFamily("fonts:Inter#Inter"));
303-
else
304-
resDic.Add("Fonts.Primary", new FontFamily(defaultFont));
305-
}
306-
else
307-
{
308-
if (!string.IsNullOrEmpty(monospaceFont))
309-
resDic.Add("Fonts.Primary", new FontFamily(monospaceFont));
310-
}
311-
312299
if (resDic.Count > 0)
313300
{
314301
app.Resources.MergedDictionaries.Add(resDic);
@@ -383,7 +370,7 @@ public override void Initialize()
383370

384371
SetLocale(pref.Locale);
385372
SetTheme(pref.Theme, pref.ThemeOverrides);
386-
SetFonts(pref.DefaultFontFamily, pref.MonospaceFontFamily, pref.OnlyUseMonoFontInEditor);
373+
SetFonts(pref.DefaultFontFamily, pref.MonospaceFontFamily);
387374
}
388375

389376
public override void OnFrameworkInitializationCompleted()

src/Resources/Locales/en_US.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,6 @@
565565
<x:String x:Key="Text.Preferences.Appearance.FontSize.Default" xml:space="preserve">Default</x:String>
566566
<x:String x:Key="Text.Preferences.Appearance.FontSize.Editor" xml:space="preserve">Editor</x:String>
567567
<x:String x:Key="Text.Preferences.Appearance.MonospaceFont" xml:space="preserve">Monospace Font</x:String>
568-
<x:String x:Key="Text.Preferences.Appearance.OnlyUseMonoFontInEditor" xml:space="preserve">Use monospace font only in text editor</x:String>
569568
<x:String x:Key="Text.Preferences.Appearance.Theme" xml:space="preserve">Theme</x:String>
570569
<x:String x:Key="Text.Preferences.Appearance.ThemeOverrides" xml:space="preserve">Theme Overrides</x:String>
571570
<x:String x:Key="Text.Preferences.Appearance.UseAutoHideScrollBars" xml:space="preserve">Use auto-hide scrollbars</x:String>

src/Resources/Styles.axaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,6 @@
301301
<Style Selector="TextBlock.italic">
302302
<Setter Property="FontStyle" Value="Italic"/>
303303
</Style>
304-
<Style Selector="TextBlock.primary, SelectableTextBlock.primary">
305-
<Setter Property="FontFamily" Value="{DynamicResource Fonts.Primary}"/>
306-
</Style>
307304
<Style Selector="TextBlock.group_header_label">
308305
<Setter Property="Foreground" Value="{DynamicResource Brush.FG2}"/>
309306
<Setter Property="FontWeight" Value="Bold"/>
@@ -853,7 +850,7 @@
853850
<StackPanel Orientation="Horizontal">
854851
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"/>
855852
<Border Margin="4,0,0,0" Height="16" Background="Green" CornerRadius="8" VerticalAlignment="Center" IsVisible="{Binding IsGlobal}">
856-
<TextBlock Classes="primary" Text="GLOBAL" Margin="8,0" FontSize="10" Foreground="White"/>
853+
<TextBlock Text="GLOBAL" Margin="8,0" FontSize="10" Foreground="White"/>
857854
</Border>
858855
</StackPanel>
859856
</DataTemplate>

src/Resources/Themes.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,4 @@
8585

8686
<FontFamily x:Key="Fonts.Default">fonts:Inter#Inter</FontFamily>
8787
<FontFamily x:Key="Fonts.Monospace">fonts:SourceGit#JetBrains Mono</FontFamily>
88-
<FontFamily x:Key="Fonts.Primary">fonts:SourceGit#JetBrains Mono</FontFamily>
8988
</ResourceDictionary>

src/ViewModels/Preferences.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public string DefaultFontFamily
6565
set
6666
{
6767
if (SetProperty(ref _defaultFontFamily, value) && !_isLoading)
68-
App.SetFonts(value, _monospaceFontFamily, _onlyUseMonoFontInEditor);
68+
App.SetFonts(value, _monospaceFontFamily);
6969
}
7070
}
7171

@@ -75,17 +75,7 @@ public string MonospaceFontFamily
7575
set
7676
{
7777
if (SetProperty(ref _monospaceFontFamily, value) && !_isLoading)
78-
App.SetFonts(_defaultFontFamily, value, _onlyUseMonoFontInEditor);
79-
}
80-
}
81-
82-
public bool OnlyUseMonoFontInEditor
83-
{
84-
get => _onlyUseMonoFontInEditor;
85-
set
86-
{
87-
if (SetProperty(ref _onlyUseMonoFontInEditor, value) && !_isLoading)
88-
App.SetFonts(_defaultFontFamily, _monospaceFontFamily, _onlyUseMonoFontInEditor);
78+
App.SetFonts(_defaultFontFamily, value);
8979
}
9080
}
9181

@@ -721,7 +711,6 @@ private bool RemoveInvalidRepositoriesRecursive(List<RepositoryNode> collection)
721711
private string _themeOverrides = string.Empty;
722712
private string _defaultFontFamily = string.Empty;
723713
private string _monospaceFontFamily = string.Empty;
724-
private bool _onlyUseMonoFontInEditor = true;
725714
private double _defaultFontSize = 13;
726715
private double _editorFontSize = 13;
727716
private int _editorTabWidth = 4;

src/Views/About.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
Cursor="Hand"
5353
PointerPressed="OnVisitReleaseNotes"
5454
ToolTip.Tip="{DynamicResource Text.About.ReleaseNotes}">
55-
<TextBlock x:Name="TxtVersion" Classes="primary" Margin="8,0" FontSize="12" Foreground="White"/>
55+
<TextBlock x:Name="TxtVersion" Margin="8,0" FontSize="12" Foreground="White"/>
5656
</Border>
5757
</StackPanel>
5858

src/Views/AddToIgnore.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<TextBlock Grid.Column="1" Text="{Binding File, Mode=OneWay}" VerticalAlignment="Center"/>
4848

4949
<Border Grid.Column="2" Height="16" Background="{Binding Brush}" CornerRadius="8" VerticalAlignment="Center">
50-
<TextBlock Classes="primary" Text="{Binding Desc}" Margin="8,0" FontSize="10" Foreground="White"/>
50+
<TextBlock Text="{Binding Desc}" Margin="8,0" FontSize="10" Foreground="White"/>
5151
</Border>
5252
</Grid>
5353
</DataTemplate>

src/Views/ApplyStash.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
HorizontalAlignment="Left" VerticalAlignment="Center"
2323
Data="{StaticResource Icons.Stashes}"/>
2424

25-
<TextBlock Grid.Column="1" VerticalAlignment="Center" Classes="primary" Text="{Binding Stash.Name}" Foreground="DarkOrange"/>
25+
<TextBlock Grid.Column="1" VerticalAlignment="Center" Text="{Binding Stash.Name}" Foreground="DarkOrange"/>
2626
<TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding Stash.Subject}" TextTrimming="CharacterEllipsis" Margin="4,0,0,0"/>
2727
</Grid>
2828

src/Views/Archive.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<DataTemplate DataType="m:Commit">
3131
<Grid ColumnDefinitions="Auto,Auto,*">
3232
<Path Grid.Column="0" Width="14" Height="14" Data="{StaticResource Icons.Commit}"/>
33-
<TextBlock Grid.Column="1" Classes="primary" VerticalAlignment="Center" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0"/>
33+
<TextBlock Grid.Column="1" VerticalAlignment="Center" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0"/>
3434
<TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding Subject}" Margin="4,0,0,0" TextTrimming="CharacterEllipsis"/>
3535
</Grid>
3636
</DataTemplate>

src/Views/BranchCompare.axaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@
4646
VerticalAlignment="Center"
4747
IsHitTestVisible="False"
4848
User="{Binding BaseHead.Author}"/>
49-
<TextBlock Grid.Column="1" Classes="primary" Text="{Binding BaseHead.Author.Name}" Margin="8,0,0,0"/>
49+
<TextBlock Grid.Column="1" Text="{Binding BaseHead.Author.Name}" Margin="8,0,0,0"/>
5050
<Border Grid.Column="2" Background="{DynamicResource Brush.Accent}" CornerRadius="4">
51-
<TextBlock Text="{Binding Base.FriendlyName}" Classes="primary" Margin="4,0" Foreground="#FFDDDDDD"/>
51+
<TextBlock Text="{Binding Base.FriendlyName}" Margin="4,0" Foreground="#FFDDDDDD"/>
5252
</Border>
53-
<TextBlock Grid.Column="3" Classes="primary" Text="{Binding BaseHead.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" Cursor="Hand" PointerPressed="OnPressedSHA"/>
54-
<TextBlock Grid.Column="4" Classes="primary" Text="{Binding BaseHead.CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
53+
<TextBlock Grid.Column="3" Text="{Binding BaseHead.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" Cursor="Hand" PointerPressed="OnPressedSHA"/>
54+
<TextBlock Grid.Column="4" Text="{Binding BaseHead.CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
5555
</Grid>
5656

57-
<TextBlock Grid.Row="1" Classes="primary" Text="{Binding BaseHead.Subject}" VerticalAlignment="Bottom"/>
57+
<TextBlock Grid.Row="1" Text="{Binding BaseHead.Subject}" VerticalAlignment="Bottom"/>
5858
</Grid>
5959
</Border>
6060

@@ -70,15 +70,15 @@
7070
VerticalAlignment="Center"
7171
IsHitTestVisible="False"
7272
User="{Binding ToHead.Author}"/>
73-
<TextBlock Grid.Column="1" Classes="primary" Text="{Binding ToHead.Author.Name}" Margin="8,0,0,0"/>
73+
<TextBlock Grid.Column="1" Text="{Binding ToHead.Author.Name}" Margin="8,0,0,0"/>
7474
<Border Grid.Column="2" Background="{DynamicResource Brush.Accent}" CornerRadius="4">
75-
<TextBlock Text="{Binding To.FriendlyName}" Classes="primary" Margin="4,0" Foreground="#FFDDDDDD"/>
75+
<TextBlock Text="{Binding To.FriendlyName}" Margin="4,0" Foreground="#FFDDDDDD"/>
7676
</Border>
77-
<TextBlock Grid.Column="3" Classes="primary" Text="{Binding ToHead.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" Cursor="Hand" PointerPressed="OnPressedSHA"/>
78-
<TextBlock Grid.Column="4" Classes="primary" Text="{Binding ToHead.CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
77+
<TextBlock Grid.Column="3" Text="{Binding ToHead.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" Cursor="Hand" PointerPressed="OnPressedSHA"/>
78+
<TextBlock Grid.Column="4" Text="{Binding ToHead.CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
7979
</Grid>
8080

81-
<TextBlock Grid.Row="1" Classes="primary" Text="{Binding ToHead.Subject}" VerticalAlignment="Bottom"/>
81+
<TextBlock Grid.Row="1" Text="{Binding ToHead.Subject}" VerticalAlignment="Bottom"/>
8282
</Grid>
8383
</Border>
8484
</Grid>

0 commit comments

Comments
 (0)