Merge pull request #3087 from Jack251970/dev1

Add new public api function BackToQueryResults for chaning the query list back to query results list
This commit is contained in:
Jeremy Wu 2024-12-08 16:31:54 +11:00 committed by GitHub
commit ac872ac55c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 3 deletions

View file

@ -1,4 +1,4 @@
using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher.Plugin.SharedModels;
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
@ -295,11 +295,17 @@ namespace Flow.Launcher.Plugin
/// <summary>
/// Reloads the query.
/// This method should run
/// This method should run when selected item is from query results.
/// </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();
/// <summary>
/// Displays a standardised Flow message box.
/// </summary>

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
@ -319,6 +319,8 @@ namespace Flow.Launcher
public void ReQuery(bool reselect = true) => _mainVM.ReQuery(reselect);
public void BackToQueryResults() => _mainVM.BackToQueryResults();
public MessageBoxResult ShowMsgBox(string messageBoxText, string caption = "", MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.OK) =>
MessageBoxEx.Show(messageBoxText, caption, button, icon, defaultResult);

View file

@ -486,6 +486,14 @@ namespace Flow.Launcher.ViewModel
}
}
public void BackToQueryResults()
{
if (!SelectedIsFromQueryResults())
{
SelectedResults = Results;
}
}
[RelayCommand]
public void ToggleGameMode()
{