add new public api for chaning the query list back to query results list

This commit is contained in:
Jack251970 2024-11-21 19:18:05 +08:00
parent 7e9ed8e47a
commit 3c3087793a
3 changed files with 17 additions and 1 deletions

View file

@ -298,5 +298,11 @@ namespace Flow.Launcher.Plugin
/// </summary>
/// <param name="reselect">Choose the first result after reload if true; keep the last selected result if false. Default is true.</param>
public void ReQuery(bool reselect = true);
/// <summary>
/// Back to the query results.
/// This method should run when selected item is from context menu or history.
/// </summary>
public void BackToQueryResults();
}
}

View file

@ -318,6 +318,8 @@ namespace Flow.Launcher
public void ReQuery(bool reselect = true) => _mainVM.ReQuery(reselect);
public void BackToQueryResults() => _mainVM.BackToQueryResults();
#endregion
#region Private Methods

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
@ -484,6 +484,14 @@ namespace Flow.Launcher.ViewModel
}
}
public void BackToQueryResults()
{
if (!SelectedIsFromQueryResults())
{
SelectedResults = Results;
}
}
[RelayCommand]
public void ToggleGameMode()
{