From 626ebfe65da099f0b93e1564fa2b22076133b969 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sat, 4 Jan 2025 20:42:42 +0800 Subject: [PATCH] Improved ModifyFontSize --- .../ViewModels/ThemeSettingViewModel.cs | 9 +++++---- .../v2rayN/ViewModels/ThemeSettingViewModel.cs | 17 +++++++++++------ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs b/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs index 604e2077..63759525 100644 --- a/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs +++ b/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs @@ -31,6 +31,7 @@ namespace v2rayN.Desktop.ViewModels { ModifyTheme(); ModifyFontFamily(); + ModifyFontSize(); } private void BindingUI() @@ -67,11 +68,10 @@ namespace v2rayN.Desktop.ViewModels y => y > 0) .Subscribe(c => { - if (CurrentFontSize >= Global.MinFontSize) + if (_config.UiItem.CurrentFontSize != CurrentFontSize && CurrentFontSize >= Global.MinFontSize) { _config.UiItem.CurrentFontSize = CurrentFontSize; - double size = CurrentFontSize; - ModifyFontSize(size); + ModifyFontSize(); ConfigHandler.SaveConfig(_config); } }); @@ -100,8 +100,9 @@ namespace v2rayN.Desktop.ViewModels } } - private void ModifyFontSize(double size) + private void ModifyFontSize() { + double size = CurrentFontSize; Style style = new(x => Selectors.Or( x.OfType