mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
- Add MaxWidth Limit
- Size reflect to Slider
This commit is contained in:
parent
753e261d6b
commit
644c56026a
2 changed files with 17 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ namespace Flow.Launcher.ViewModel
|
|||
case nameof(Settings.ActivateTimes):
|
||||
OnPropertyChanged(nameof(ActivatedTimes));
|
||||
break;
|
||||
case nameof(Settings.WindowSize):
|
||||
OnPropertyChanged(nameof(WindowWidthSize));
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue