From e24af1478496c446ebde7f8c234d751fbbabc122 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 28 Jun 2025 22:11:55 +0800 Subject: [PATCH] Add hotkey ids for all results --- .../Search/ResultManager.cs | 20 +++++++++--- .../PluginsManager.cs | 31 ++++++++++++++----- .../Programs/UWPPackage.cs | 6 +++- .../Programs/Win32.cs | 6 +++- 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 9063217c1..68c1f0ccc 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -1,9 +1,9 @@ using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using System.Windows.Controls; -using System.Windows.Input; using Flow.Launcher.Plugin.Explorer.Search.Everything; using Flow.Launcher.Plugin.Explorer.Views; using Flow.Launcher.Plugin.SharedCommands; @@ -133,7 +133,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search Score = score, TitleToolTip = Main.Context.API.GetTranslation("plugin_explorer_plugin_ToolTipOpenDirectory"), SubTitleToolTip = Settings.DisplayMoreInformationInToolTip ? GetFolderMoreInfoTooltip(path) : path, - ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path, WindowsIndexed = windowsIndexed } + ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path, WindowsIndexed = windowsIndexed }, + HotkeyIds = new List + { + 0, 1, 2, 3 + }, }; } @@ -238,7 +242,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search OpenFolder(folderPath); return true; }, - ContextData = new SearchResult { Type = ResultType.Folder, FullPath = folderPath, WindowsIndexed = windowsIndexed } + ContextData = new SearchResult { Type = ResultType.Folder, FullPath = folderPath, WindowsIndexed = windowsIndexed }, + HotkeyIds = new List + { + 1 + }, }; } @@ -280,7 +288,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search }, TitleToolTip = Main.Context.API.GetTranslation("plugin_explorer_plugin_ToolTipOpenContainingFolder"), SubTitleToolTip = Settings.DisplayMoreInformationInToolTip ? GetFileMoreInfoTooltip(filePath) : filePath, - ContextData = new SearchResult { Type = ResultType.File, FullPath = filePath, WindowsIndexed = windowsIndexed } + ContextData = new SearchResult { Type = ResultType.File, FullPath = filePath, WindowsIndexed = windowsIndexed }, + HotkeyIds = new List + { + 0, 1, 2, 3 + }, }; return result; } diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs index 99282b7ab..a0990f5e3 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs @@ -388,12 +388,15 @@ namespace Flow.Launcher.Plugin.PluginsManager return true; }, - ContextData = - new UserPlugin - { - Website = x.PluginNewUserPlugin.Website, - UrlSourceCode = x.PluginNewUserPlugin.UrlSourceCode - } + ContextData = new UserPlugin + { + Website = x.PluginNewUserPlugin.Website, + UrlSourceCode = x.PluginNewUserPlugin.UrlSourceCode + }, + HotkeyIds = new List + { + 0 + }, }); // Update all result @@ -631,7 +634,11 @@ namespace Flow.Launcher.Plugin.PluginsManager _ = InstallOrUpdateAsync(x); // No need to wait return ShouldHideWindow; }, - ContextData = x + ContextData = x, + HotkeyIds = new List + { + 0 + }, }); return Search(results, search); @@ -724,7 +731,15 @@ namespace Flow.Launcher.Plugin.PluginsManager } return false; - } + }, + ContextData = new UserPlugin + { + Website = x.Metadata.Website + }, + HotkeyIds = new List + { + 0 + }, }); return Search(results, search); diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs index 116717b2f..9ac1f6f69 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs @@ -457,7 +457,11 @@ namespace Flow.Launcher.Plugin.Program.Programs } return true; - } + }, + HotkeyIds = new List + { + 0 + }, }; diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index 038257e47..dba638f1a 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -199,7 +199,11 @@ namespace Flow.Launcher.Plugin.Program.Programs _ = Task.Run(() => Main.StartProcess(Process.Start, info)); return true; - } + }, + HotkeyIds = new List + { + 0 + }, }; return result;