- Remove visible/collapsed code (only using opacity)

- Remove All Delay
This commit is contained in:
DB p 2021-11-22 15:45:08 +09:00
parent e30af374c9
commit e282fc5d38
2 changed files with 2 additions and 15 deletions

View file

@ -348,16 +348,12 @@ 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();

View file

@ -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,29 +714,20 @@ 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;
MainWindowVisibility = Visibility.Collapsed;
MainWindowOpacity = 0;
}
#endregion