From 833857d940686f606e114b117a61097a9a6185a2 Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 13 Oct 2022 13:57:42 +0900 Subject: [PATCH] Fix Max/Min Logic --- Flow.Launcher/ViewModel/MainViewModel.cs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 0cc3ed825..8be81d29b 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -363,18 +363,30 @@ namespace Flow.Launcher.ViewModel [RelayCommand] private void IncreaseWidth() { - if (_settings.WindowSize > 1920) return; - _settings.WindowSize += 100; - Left -= 50; + if (MainWindowWidth + 100 > 1920 || _settings.WindowSize == 1920) + { + _settings.WindowSize = 1920; + } + else + { + _settings.WindowSize += 100; + Left -= 50; + } OnPropertyChanged(); } [RelayCommand] private void DecreaseWidth() { - if (_settings.WindowSize < 400) return; - Left += 50; - _settings.WindowSize -= 100; + if (MainWindowWidth - 100 < 400 || _settings.WindowSize == 400) + { + _settings.WindowSize = 400; + } + else + { + Left += 50; + _settings.WindowSize -= 100; + } OnPropertyChanged(); }