Skip to content

Commit a83f9df

Browse files
committed
Revert "Use Hacky way to show up windows when width change."
This reverts commit 64a489b.
1 parent 64a489b commit a83f9df

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public class MainViewModel : BaseModel, ISavable
5252

5353
private ChannelWriter<ResultsForUpdate> _resultsUpdateChannelWriter;
5454
private Task _resultsViewUpdateTask;
55-
private bool _keepVisibility = false;
5655

5756
#endregion
5857

@@ -65,20 +64,10 @@ public MainViewModel(Settings settings)
6564
_lastQuery = new Query();
6665

6766
_settings = settings;
68-
_settings.PropertyChanged += async (_, args) =>
67+
_settings.PropertyChanged += (_, args) =>
6968
{
7069
if (args.PropertyName == nameof(Settings.WindowSize))
7170
{
72-
ChangeQueryText("");
73-
if (MainWindowVisibility == Visibility.Collapsed)
74-
{
75-
ToggleFlowLauncher();
76-
_keepVisibility = true;
77-
await Task.Delay(1000);
78-
_keepVisibility = false;
79-
Application.Current.MainWindow.Activate();
80-
}
81-
8271
OnPropertyChanged(nameof(MainWindowWidth));
8372
}
8473
};
@@ -753,7 +742,7 @@ public async void ToggleFlowLauncher()
753742

754743
public void Hide()
755744
{
756-
if (MainWindowVisibility != Visibility.Collapsed && !_keepVisibility)
745+
if (MainWindowVisibility != Visibility.Collapsed)
757746
{
758747
ToggleFlowLauncher();
759748
}

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,11 @@ public bool DropShadowEffect
309309
public double WindowWidthSize
310310
{
311311
get => Settings.WindowSize;
312-
set => Settings.WindowSize = value;
312+
set
313+
{
314+
Settings.WindowSize = value;
315+
Application.Current.MainWindow.Visibility = Visibility.Visible;
316+
}
313317
}
314318

315319
public bool UseGlyphIcons

0 commit comments

Comments
 (0)