- Add MaxWidth Limit

- Size reflect to Slider
This commit is contained in:
DB p 2022-10-10 15:33:33 +09:00
parent 753e261d6b
commit 644c56026a
2 changed files with 17 additions and 3 deletions

View file

@ -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<History>();
_userSelectedRecordStorage = new FlowLauncherJsonStorage<UserSelectedRecord>();
@ -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;
}

View file

@ -41,6 +41,9 @@ namespace Flow.Launcher.ViewModel
case nameof(Settings.ActivateTimes):
OnPropertyChanged(nameof(ActivatedTimes));
break;
case nameof(Settings.WindowSize):
OnPropertyChanged(nameof(WindowWidthSize));
break;
}
};
}