feature: add a toggle button in Preference dialog to only use monospace font in code editor (#292)

This commit is contained in:
leo 2024-07-29 20:20:27 +08:00
parent d2d95e09b7
commit aea61e0067
No known key found for this signature in database
6 changed files with 26 additions and 2 deletions

View file

@ -92,6 +92,22 @@ namespace SourceGit.ViewModels
set => SetProperty(ref _monospaceFont, value);
}
[JsonIgnore]
public FontFamily PrimaryFont
{
get => _onlyUseMonoFontInEditor ? _defaultFont : _monospaceFont;
}
public bool OnlyUseMonoFontInEditor
{
get => _onlyUseMonoFontInEditor;
set
{
if (SetProperty(ref _onlyUseMonoFontInEditor, value))
OnPropertyChanged(nameof(PrimaryFont));
}
}
public double DefaultFontSize
{
get => _defaultFontSize;
@ -486,6 +502,7 @@ namespace SourceGit.ViewModels
private string _themeOverrides = string.Empty;
private FontFamily _defaultFont = null;
private FontFamily _monospaceFont = null;
private bool _onlyUseMonoFontInEditor = false;
private double _defaultFontSize = 13;
private LayoutInfo _layout = new LayoutInfo();