From b18f86dde93078fb519e666d12b3f8b89110ea08 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 30 Jul 2024 10:29:07 +0800 Subject: [PATCH] fix: ui not updated after font changed --- src/ViewModels/Preference.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 8cc05696..4142bf39 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -83,13 +83,21 @@ namespace SourceGit.ViewModels public FontFamily DefaultFont { get => _defaultFont; - set => SetProperty(ref _defaultFont, value); + set + { + if (SetProperty(ref _defaultFont, value) && _onlyUseMonoFontInEditor) + OnPropertyChanged(nameof(PrimaryFont)); + } } public FontFamily MonospaceFont { get => _monospaceFont; - set => SetProperty(ref _monospaceFont, value); + set + { + if (SetProperty(ref _monospaceFont, value) && !_onlyUseMonoFontInEditor) + OnPropertyChanged(nameof(PrimaryFont)); + } } [JsonIgnore]