diff --git a/Flow.Launcher/Helper/HotKeyMapper.cs b/Flow.Launcher/Helper/HotKeyMapper.cs index 87ef0628b..b9eee1a17 100644 --- a/Flow.Launcher/Helper/HotKeyMapper.cs +++ b/Flow.Launcher/Helper/HotKeyMapper.cs @@ -60,8 +60,8 @@ namespace Flow.Launcher.Helper if (!ShouldIgnoreHotkeys()) { UpdateLastQUeryMode(); - - var overlayTask = Task.Delay(20).ContinueWith(_ => { + mainViewModel.ToggleFlowLauncherOpacity(); + var overlayTask = Task.Delay(30).ContinueWith(_ => { mainViewModel.ToggleFlowLauncher(); }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); e.Handled = true; diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 4212280bb..80378f018 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -14,6 +14,7 @@ using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; +using Flow.Launcher.Helper; using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Storage; using Flow.Launcher.Infrastructure.Logger; @@ -156,7 +157,15 @@ namespace Flow.Launcher.ViewModel } else { - MainWindowVisibility = Visibility.Collapsed; + + + Application.Current.MainWindow.Opacity = 0; + + var overlayTask = Task.Delay(30).ContinueWith(_ => { + MainWindowVisibility = Visibility.Collapsed; + }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); + + } }); @@ -664,14 +673,30 @@ namespace Flow.Launcher.ViewModel { if (MainWindowVisibility != Visibility.Visible) { + MainWindowVisibility = Visibility.Visible; } else { + MainWindowVisibility = Visibility.Collapsed; } } + internal void ToggleFlowLauncherOpacity() + { + if (MainWindowVisibility != Visibility.Visible) + { + + Application.Current.MainWindow.Opacity = 1; + } + else + { + + Application.Current.MainWindow.Opacity = 0; + } + } + #endregion #region Public Methods