Skip to content

Commit 4df1e41

Browse files
committed
Revert "- Remove visible/collapsed code (only using opacity)"
This reverts commit e282fc5.
1 parent e282fc5 commit 4df1e41

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,16 @@ private void OnPreviewDragOver(object sender, DragEventArgs e)
348348
private async void OnContextMenusForSettingsClick(object sender, RoutedEventArgs e)
349349
{
350350
_viewModel.Hide();
351+
await Task.Delay(50);
351352
App.API.OpenSettingDialog();
352353
}
353354

354355

355356
private async void OnDeactivated(object sender, EventArgs e)
356357
{
358+
// need time to initialize the main query window animation
359+
if (_settings.UseAnimation)
360+
await Task.Delay(50);
357361
if (_settings.HideWhenDeactive)
358362
{
359363
_viewModel.Hide();

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ public void ToggleFlowLauncher()
702702
public void Show()
703703
{
704704
((MainWindow)Application.Current.MainWindow).WindowAnimator();
705-
//MainWindowVisibility = Visibility.Visible;
705+
MainWindowVisibility = Visibility.Visible;
706706
WinToggleStatus = true;
707707
MainWindowOpacity = 1;
708708
}
@@ -714,20 +714,29 @@ public async void Hide()
714714
case LastQueryMode.Empty:
715715
ChangeQueryText(string.Empty);
716716
MainWindowOpacity = 0; // Trick for no delay
717+
await Task.Delay(50); //Time for change to opacity
717718
break;
718719
case LastQueryMode.Preserved:
719720
MainWindowOpacity = 0;
721+
if (_settings.UseAnimation)
722+
{
723+
await Task.Delay(50);
724+
}
720725
LastQuerySelected = true;
721726
break;
722727
case LastQueryMode.Selected:
723728
MainWindowOpacity = 0;
729+
if (_settings.UseAnimation)
730+
{
731+
await Task.Delay(50);
732+
}
724733
LastQuerySelected = false;
725734
break;
726735
default:
727736
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");
728737
}
729738
WinToggleStatus = false;
730-
MainWindowOpacity = 0;
739+
MainWindowVisibility = Visibility.Collapsed;
731740
}
732741

733742
#endregion

0 commit comments

Comments
 (0)