From 459f57c647f9a8a4798599a23fe14092e038fbc3 Mon Sep 17 00:00:00 2001 From: Stefan Markovic Date: Tue, 26 Dec 2023 10:14:21 +0100 Subject: [PATCH] update results height on font change --- .../PowerLauncher/ViewModel/ResultsViewModel.cs | 2 +- .../UserSettings/PowerToysRunSettings.cs | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/modules/launcher/PowerLauncher/ViewModel/ResultsViewModel.cs b/src/modules/launcher/PowerLauncher/ViewModel/ResultsViewModel.cs index 4047722718..787013d5ff 100644 --- a/src/modules/launcher/PowerLauncher/ViewModel/ResultsViewModel.cs +++ b/src/modules/launcher/PowerLauncher/ViewModel/ResultsViewModel.cs @@ -50,7 +50,7 @@ namespace PowerLauncher.ViewModel { get { - return (_settings.MaxResultsToShow * 56) + 16; + return (int)(_settings.MaxResultsToShow * (52 + (0.4 * _settings.TitleFontSize))) + 16; } } diff --git a/src/modules/launcher/Wox.Infrastructure/UserSettings/PowerToysRunSettings.cs b/src/modules/launcher/Wox.Infrastructure/UserSettings/PowerToysRunSettings.cs index cb993dc4fe..17748cc908 100644 --- a/src/modules/launcher/Wox.Infrastructure/UserSettings/PowerToysRunSettings.cs +++ b/src/modules/launcher/Wox.Infrastructure/UserSettings/PowerToysRunSettings.cs @@ -341,7 +341,21 @@ namespace Wox.Infrastructure.UserSettings } } - public int TitleFontSize { get; set; } = 16; + private int _titleFontSize = 16; + + public int TitleFontSize + { + get => _titleFontSize; + set + { + if (_titleFontSize != value) + { + _titleFontSize = value; + OnPropertyChanged(nameof(TitleFontSize)); + OnPropertyChanged(nameof(MaxResultsToShow)); + } + } + } public bool IgnoreHotkeysOnFullscreen { get; set; }