mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #3833 from WayneFerdon/dev
Add Empty Query Returning & Change ThemeSelector Keyword with ActionKeyword for Sys Plugin
This commit is contained in:
commit
3e1f962acf
1 changed files with 17 additions and 3 deletions
|
|
@ -70,13 +70,19 @@ namespace Flow.Launcher.Plugin.Sys
|
|||
return _themeSelector.Query(query);
|
||||
}
|
||||
|
||||
var commands = Commands();
|
||||
var commands = Commands(query);
|
||||
var results = new List<Result>();
|
||||
var isEmptyQuery = string.IsNullOrWhiteSpace(query.Search);
|
||||
foreach (var c in commands)
|
||||
{
|
||||
var command = _settings.Commands.First(x => x.Key == c.Title);
|
||||
c.Title = command.Name;
|
||||
c.SubTitle = command.Description;
|
||||
if (isEmptyQuery)
|
||||
{
|
||||
results.Add(c);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Match from localized title & localized subtitle & keyword
|
||||
var titleMatch = _context.API.FuzzySearch(query.Search, c.Title);
|
||||
|
|
@ -188,7 +194,7 @@ namespace Flow.Launcher.Plugin.Sys
|
|||
}
|
||||
}
|
||||
|
||||
private List<Result> Commands()
|
||||
private List<Result> Commands(Query query)
|
||||
{
|
||||
var results = new List<Result>();
|
||||
var recycleBinFolder = "shell:RecycleBinFolder";
|
||||
|
|
@ -491,7 +497,15 @@ namespace Flow.Launcher.Plugin.Sys
|
|||
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\ue790"),
|
||||
Action = c =>
|
||||
{
|
||||
_context.API.ChangeQuery($"{ThemeSelector.Keyword} ");
|
||||
if (string.IsNullOrEmpty(query.ActionKeyword))
|
||||
{
|
||||
_context.API.ChangeQuery($"{ThemeSelector.Keyword}{Plugin.Query.ActionKeywordSeparator}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_context.API.ChangeQuery($"{query.ActionKeyword}{Plugin.Query.ActionKeywordSeparator}{ThemeSelector.Keyword}{Plugin.Query.ActionKeywordSeparator}");
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue