Skip to content

Commit 60064ea

Browse files
committed
Merge branch 'FixEmptyQuery' of https://github.com/onesounds/Flow.Launcher into FixEmptyQuery
2 parents ad186a3 + 4a37900 commit 60064ea

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

Flow.Launcher/Helper/HotKeyMapper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ internal static void OnHotkey(object sender, HotkeyEventArgs e)
6060
if (!ShouldIgnoreHotkeys())
6161
{
6262
UpdateLastQUeryMode();
63-
mainViewModel.ToggleFlowLauncherOpacity();
6463
var overlayTask = Task.Delay(30).ContinueWith(_ => {
6564
mainViewModel.ToggleFlowLauncher();
6665
});

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public class MainViewModel : BaseModel, ISavable
5050
private ChannelWriter<ResultsForUpdate> _resultsUpdateChannelWriter;
5151
private Task _resultsViewUpdateTask;
5252

53+
54+
5355
#endregion
5456

5557
#region Constructor
@@ -145,6 +147,24 @@ private void RegisterResultsUpdatedEvent()
145147
}
146148
}
147149

150+
private void UpdateLastQUeryMode()
151+
{
152+
switch (_settings.LastQueryMode)
153+
{
154+
case LastQueryMode.Empty:
155+
ChangeQueryText(string.Empty);
156+
break;
157+
case LastQueryMode.Preserved:
158+
LastQuerySelected = true;
159+
break;
160+
case LastQueryMode.Selected:
161+
LastQuerySelected = false;
162+
break;
163+
default:
164+
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");
165+
166+
}
167+
}
148168

149169
private void InitializeKeyCommands()
150170
{
@@ -156,15 +176,10 @@ private void InitializeKeyCommands()
156176
}
157177
else
158178
{
159-
160-
161-
Application.Current.MainWindow.Opacity = 0;
162-
179+
UpdateLastQUeryMode();
163180
var overlayTask = Task.Delay(30).ContinueWith(_ => {
164181
MainWindowVisibility = Visibility.Collapsed;
165182
});
166-
167-
168183
}
169184
});
170185

@@ -672,30 +687,14 @@ internal void ToggleFlowLauncher()
672687
{
673688
if (MainWindowVisibility != Visibility.Visible)
674689
{
675-
676690
MainWindowVisibility = Visibility.Visible;
677691
}
678692
else
679693
{
680-
681694
MainWindowVisibility = Visibility.Collapsed;
682695
}
683696
}
684697

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

701700
#region Public Methods

0 commit comments

Comments
 (0)