Skip to content

Commit 3c30877

Browse files
committed
add new public api for chaning the query list back to query results list
1 parent 7e9ed8e commit 3c30877

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,5 +298,11 @@ public interface IPublicAPI
298298
/// </summary>
299299
/// <param name="reselect">Choose the first result after reload if true; keep the last selected result if false. Default is true.</param>
300300
public void ReQuery(bool reselect = true);
301+
302+
/// <summary>
303+
/// Back to the query results.
304+
/// This method should run when selected item is from context menu or history.
305+
/// </summary>
306+
public void BackToQueryResults();
301307
}
302308
}

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ public bool IsGameModeOn()
318318

319319
public void ReQuery(bool reselect = true) => _mainVM.ReQuery(reselect);
320320

321+
public void BackToQueryResults() => _mainVM.BackToQueryResults();
322+
321323
#endregion
322324

323325
#region Private Methods

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading;
@@ -484,6 +484,14 @@ private void Esc()
484484
}
485485
}
486486

487+
public void BackToQueryResults()
488+
{
489+
if (!SelectedIsFromQueryResults())
490+
{
491+
SelectedResults = Results;
492+
}
493+
}
494+
487495
[RelayCommand]
488496
public void ToggleGameMode()
489497
{

0 commit comments

Comments
 (0)