diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index cca9d494262..e997df1280d 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -91,7 +91,8 @@ public bool ShowOpenResultHotkey } } - public double WindowSize { get; set; } = 580; + public const double DefaultWindowSize = 580; + public double WindowSize { get; set; } = DefaultWindowSize; public string PreviewHotkey { get; set; } = $"F1"; public string AutoCompleteHotkey { get; set; } = $"{KeyConstant.Ctrl} + Tab"; public string AutoCompleteHotkey2 { get; set; } = $""; @@ -500,7 +501,21 @@ public bool KeepMaxResults } } - public int MaxResultsToShow { get; set; } = 5; + public const int DefaultMaxResultsToShow = 5; + public int MaxResultsToShow { get; set; } = DefaultMaxResultsToShow; + + public void ResetSearchWindowSize() + { + if (WindowSize == DefaultWindowSize) + OnPropertyChanged(nameof(WindowSize)); + else + WindowSize = DefaultWindowSize; + + if (MaxResultsToShow == DefaultMaxResultsToShow) + OnPropertyChanged(nameof(MaxResultsToShow)); + else + MaxResultsToShow = DefaultMaxResultsToShow; + } public int ActivateTimes { get; set; } diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index c8c4d5fdf32..7c250c85f8f 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -530,6 +530,7 @@ public void Reset() WindowHeightSize = 42; ItemHeightSize = 58; + Settings.ResetSearchWindowSize(); } [RelayCommand]