diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index cc605edc9..9f7d16ab1 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -32,9 +32,7 @@ Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" WindowStartupLocation="Manual" WindowStyle="None" - mc:Ignorable="d" - Left="{Binding Left, Mode=TwoWay}" - Top="{Binding Top, Mode=TwoWay}"> + mc:Ignorable="d"> @@ -88,20 +86,20 @@ + Command="{Binding IncreaseWidthCommand}" + Modifiers="Control" /> + Command="{Binding DecreaseWidthCommand}" + Modifiers="Control" /> + Command="{Binding IncreaseMaxResultCommand}" + Modifiers="Control" /> + Command="{Binding DecreaseMaxResultCommand}" + Modifiers="Control" /> diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 4f0c723e9..2e601c23c 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -108,7 +108,6 @@ namespace Flow.Launcher animationSound.Position = TimeSpan.Zero; animationSound.Play(); } - UpdatePosition(); Activate(); QueryTextBox.Focus(); @@ -161,6 +160,7 @@ namespace Flow.Launcher _viewModel.QueryTextCursorMovedToEnd = false; } break; + } }; _settings.PropertyChanged += (o, e) => @@ -176,6 +176,12 @@ namespace Flow.Launcher case nameof(Settings.Hotkey): UpdateNotifyIconText(); break; + case nameof(Settings.WindowLeft): + Left = _settings.WindowLeft; + break; + case nameof(Settings.WindowTop): + Top = _settings.WindowTop; + break; } }; } @@ -311,9 +317,10 @@ namespace Flow.Launcher } private void PositionReset() { - Left = WindowLeft(); - Top = WindowTop(); - + _settings.WindowLeft = WindowLeft(); + _settings.WindowTop = WindowTop(); + // Left = _settings.WindowLeft; + //Top = _settings.WindowTop; } private void InitProgressbarAnimation() { @@ -469,15 +476,6 @@ namespace Flow.Launcher _viewModel.Show(); } } - - private void InitializePosition() - { - if (!_settings.RememberLastLaunchLocation) - { - Left = WindowLeft(); - Top = WindowTop(); - } - } public double WindowLeft() { diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 2f07f43db..57c791f5e 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -341,25 +341,6 @@ namespace Flow.Launcher.ViewModel } - public double Top - { - get => _settings.WindowTop; - set - { - _settings.WindowTop = value; - OnPropertyChanged(); - } - } - public double Left - { - get => _settings.WindowLeft; - set - { - _settings.WindowLeft = value; - OnPropertyChanged(); - } - } - [RelayCommand] private void IncreaseWidth() { @@ -370,7 +351,7 @@ namespace Flow.Launcher.ViewModel else { _settings.WindowSize += 100; - Left -= 50; + _settings.WindowLeft -= 50; } OnPropertyChanged(); } @@ -384,7 +365,7 @@ namespace Flow.Launcher.ViewModel } else { - Left += 50; + _settings.WindowLeft += 50; _settings.WindowSize -= 100; } OnPropertyChanged();