diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 6245d4a36..b1a23a79c 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -348,12 +348,16 @@ namespace Flow.Launcher private async void OnContextMenusForSettingsClick(object sender, RoutedEventArgs e) { _viewModel.Hide(); + await Task.Delay(50); App.API.OpenSettingDialog(); } private async void OnDeactivated(object sender, EventArgs e) { + // need time to initialize the main query window animation + if (_settings.UseAnimation) + await Task.Delay(50); if (_settings.HideWhenDeactive) { _viewModel.Hide(); diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 61326d911..c0074f1a9 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -702,7 +702,7 @@ namespace Flow.Launcher.ViewModel public void Show() { ((MainWindow)Application.Current.MainWindow).WindowAnimator(); - //MainWindowVisibility = Visibility.Visible; + MainWindowVisibility = Visibility.Visible; WinToggleStatus = true; MainWindowOpacity = 1; } @@ -714,20 +714,29 @@ namespace Flow.Launcher.ViewModel case LastQueryMode.Empty: ChangeQueryText(string.Empty); MainWindowOpacity = 0; // Trick for no delay + await Task.Delay(50); //Time for change to opacity break; case LastQueryMode.Preserved: MainWindowOpacity = 0; + if (_settings.UseAnimation) + { + await Task.Delay(50); + } LastQuerySelected = true; break; case LastQueryMode.Selected: MainWindowOpacity = 0; + if (_settings.UseAnimation) + { + await Task.Delay(50); + } LastQuerySelected = false; break; default: throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>"); } WinToggleStatus = false; - MainWindowOpacity = 0; + MainWindowVisibility = Visibility.Collapsed; } #endregion