Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions Flow.Launcher/Helper/HotKeyMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ internal static void OnHotkey(object sender, HotkeyEventArgs e)
{
if (!ShouldIgnoreHotkeys())
{
UpdateLastQUeryMode();
if (settings.LastQueryMode == LastQueryMode.Empty)
mainViewModel.ChangeQueryText(string.Empty);

mainViewModel.ToggleFlowLauncher();

e.Handled = true;
}
}
Expand All @@ -72,25 +74,6 @@ private static bool ShouldIgnoreHotkeys()
return settings.IgnoreHotkeysOnFullscreen && WindowsInteropHelper.IsWindowFullscreen();
}

private static void UpdateLastQUeryMode()
{
switch(settings.LastQueryMode)
{
case LastQueryMode.Empty:
mainViewModel.ChangeQueryText(string.Empty);
break;
case LastQueryMode.Preserved:
mainViewModel.LastQuerySelected = true;
break;
case LastQueryMode.Selected:
mainViewModel.LastQuerySelected = false;
break;
default:
throw new ArgumentException($"wrong LastQueryMode: <{settings.LastQueryMode}>");

}
}

internal static void LoadCustomPluginHotkey()
{
if (settings.CustomPluginHotkeys == null)
Expand Down
8 changes: 3 additions & 5 deletions Flow.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ private void OnLoaded(object sender, RoutedEventArgs _)
QueryTextBox.Focus();
UpdatePosition();
_settings.ActivateTimes++;
if (!_viewModel.LastQuerySelected)
{
QueryTextBox.SelectAll();
_viewModel.LastQuerySelected = true;
}

if (_settings.LastQueryMode == LastQueryMode.Selected)
QueryTextBox.SelectAll();
Comment on lines +88 to +89
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make the custom plugin keyword select the query text as well.


if (_viewModel.ProgressBarVisibility == Visibility.Visible && isProgressBarStoryboardPaused)
{
Expand Down
1 change: 0 additions & 1 deletion Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ public void ChangeQueryText(string queryText)
QueryText = queryText;
}

public bool LastQuerySelected { get; set; }
public bool QueryTextCursorMovedToEnd { get; set; }

private ResultsViewModel _selectedResults;
Expand Down