Revert "Use Hacky way to show up windows when width change."

This reverts commit 64a489b312.
This commit is contained in:
Kevin Zhang 2021-10-22 13:57:22 -05:00
parent 64a489b312
commit a83f9df19c
2 changed files with 7 additions and 14 deletions

View file

@ -52,7 +52,6 @@ namespace Flow.Launcher.ViewModel
private ChannelWriter<ResultsForUpdate> _resultsUpdateChannelWriter;
private Task _resultsViewUpdateTask;
private bool _keepVisibility = false;
#endregion
@ -65,20 +64,10 @@ namespace Flow.Launcher.ViewModel
_lastQuery = new Query();
_settings = settings;
_settings.PropertyChanged += async (_, args) =>
_settings.PropertyChanged += (_, args) =>
{
if (args.PropertyName == nameof(Settings.WindowSize))
{
ChangeQueryText("");
if (MainWindowVisibility == Visibility.Collapsed)
{
ToggleFlowLauncher();
_keepVisibility = true;
await Task.Delay(1000);
_keepVisibility = false;
Application.Current.MainWindow.Activate();
}
OnPropertyChanged(nameof(MainWindowWidth));
}
};
@ -753,7 +742,7 @@ namespace Flow.Launcher.ViewModel
public void Hide()
{
if (MainWindowVisibility != Visibility.Collapsed && !_keepVisibility)
if (MainWindowVisibility != Visibility.Collapsed)
{
ToggleFlowLauncher();
}

View file

@ -309,7 +309,11 @@ namespace Flow.Launcher.ViewModel
public double WindowWidthSize
{
get => Settings.WindowSize;
set => Settings.WindowSize = value;
set
{
Settings.WindowSize = value;
Application.Current.MainWindow.Visibility = Visibility.Visible;
}
}
public bool UseGlyphIcons