diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index e61b84046..0f2749acf 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -62,6 +62,13 @@ namespace Flow.Launcher.ViewModel _lastQuery = new Query(); _settings = settings; + _settings.PropertyChanged += (_, args) => + { + if (args.PropertyName == nameof(Settings.WindowSize)) + { + OnPropertyChanged(nameof(MainWindowWidth)); + } + }; _historyItemsStorage = new FlowLauncherJsonStorage(); _userSelectedRecordStorage = new FlowLauncherJsonStorage(); @@ -356,21 +363,25 @@ namespace Flow.Launcher.ViewModel [RelayCommand] private void IncreaseWidth() { - MainWindowWidth += 100; + if (_settings.WindowSize > 1920) return; + _settings.WindowSize += 100; Left -= 50; + OnPropertyChanged(); } [RelayCommand] private void DecreaseWidth() { - if (MainWindowWidth < 400) return; + if (_settings.WindowSize < 400) return; Left += 50; - MainWindowWidth -= 100; + _settings.WindowSize -= 100; + OnPropertyChanged(); } [RelayCommand] private void IncreaseMaxResult() { + if (_settings.MaxResultsToShow > 17) return; _settings.MaxResultsToShow += 1; } diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index 64cb9e36c..49a184e21 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -41,6 +41,9 @@ namespace Flow.Launcher.ViewModel case nameof(Settings.ActivateTimes): OnPropertyChanged(nameof(ActivatedTimes)); break; + case nameof(Settings.WindowSize): + OnPropertyChanged(nameof(WindowWidthSize)); + break; } }; }