Skip to content

Commit abf91dc

Browse files
committed
add Opacity value
1 parent 5d67019 commit abf91dc

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

Flow.Launcher/Helper/HotKeyMapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ internal static void OnHotkey(object sender, HotkeyEventArgs e)
6060
if (!ShouldIgnoreHotkeys())
6161
{
6262
UpdateLastQUeryMode();
63-
64-
var overlayTask = Task.Delay(20).ContinueWith(_ => {
63+
mainViewModel.ToggleFlowLauncherOpacity();
64+
var overlayTask = Task.Delay(30).ContinueWith(_ => {
6565
mainViewModel.ToggleFlowLauncher();
6666
}, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
6767
e.Handled = true;

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using Flow.Launcher.Infrastructure.Storage;
1515
using Flow.Launcher.Infrastructure.UserSettings;
1616
using Flow.Launcher.Plugin;
17+
using Flow.Launcher.Helper;
1718
using Flow.Launcher.Plugin.SharedCommands;
1819
using Flow.Launcher.Storage;
1920
using Flow.Launcher.Infrastructure.Logger;
@@ -156,7 +157,15 @@ private void InitializeKeyCommands()
156157
}
157158
else
158159
{
159-
MainWindowVisibility = Visibility.Collapsed;
160+
161+
162+
Application.Current.MainWindow.Opacity = 0;
163+
164+
var overlayTask = Task.Delay(30).ContinueWith(_ => {
165+
MainWindowVisibility = Visibility.Collapsed;
166+
}, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
167+
168+
160169
}
161170
});
162171

@@ -664,14 +673,30 @@ internal void ToggleFlowLauncher()
664673
{
665674
if (MainWindowVisibility != Visibility.Visible)
666675
{
676+
667677
MainWindowVisibility = Visibility.Visible;
668678
}
669679
else
670680
{
681+
671682
MainWindowVisibility = Visibility.Collapsed;
672683
}
673684
}
674685

686+
internal void ToggleFlowLauncherOpacity()
687+
{
688+
if (MainWindowVisibility != Visibility.Visible)
689+
{
690+
691+
Application.Current.MainWindow.Opacity = 1;
692+
}
693+
else
694+
{
695+
696+
Application.Current.MainWindow.Opacity = 0;
697+
}
698+
}
699+
675700
#endregion
676701

677702
#region Public Methods

0 commit comments

Comments
 (0)