Implement Requery option and requery when calling customQueryHotkey

This commit is contained in:
Kevin Zhang 2021-09-24 20:05:55 -05:00
parent 1cf2f1b06d
commit e13c64725d
3 changed files with 11 additions and 9 deletions

View file

@ -110,7 +110,7 @@ namespace Flow.Launcher.Helper
return;
mainViewModel.MainWindowVisibility = Visibility.Visible;
mainViewModel.ChangeQueryText(hotkey.ActionKeyword);
mainViewModel.ChangeQueryText(hotkey.ActionKeyword, true);
});
}

View file

@ -48,12 +48,7 @@ namespace Flow.Launcher
public void ChangeQuery(string query, bool requery = false)
{
_mainVM.ChangeQueryText(query);
}
public void ChangeQueryText(string query, bool selectAll = false)
{
_mainVM.ChangeQueryText(query);
_mainVM.ChangeQueryText(query, requery);
}
public void RestartApp()

View file

@ -285,9 +285,16 @@ namespace Flow.Launcher.ViewModel
/// but we don't want to move cursor to end when query is updated from TextBox
/// </summary>
/// <param name="queryText"></param>
public void ChangeQueryText(string queryText)
public void ChangeQueryText(string queryText, bool reQuery)
{
QueryText = queryText;
if (QueryText!=queryText)
{
QueryText = queryText;
}
else if (reQuery)
{
Query();
}
QueryTextCursorMovedToEnd = true;
}