Add hotkey ids for all results

This commit is contained in:
Jack251970 2025-06-28 22:11:55 +08:00
parent 3b4698e282
commit e24af14784
4 changed files with 49 additions and 14 deletions

View file

@ -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<int>
{
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<int>
{
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<int>
{
0, 1, 2, 3
},
};
return result;
}

View file

@ -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<int>
{
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<int>
{
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<int>
{
0
},
});
return Search(results, search);

View file

@ -457,7 +457,11 @@ namespace Flow.Launcher.Plugin.Program.Programs
}
return true;
}
},
HotkeyIds = new List<int>
{
0
},
};

View file

@ -199,7 +199,11 @@ namespace Flow.Launcher.Plugin.Program.Programs
_ = Task.Run(() => Main.StartProcess(Process.Start, info));
return true;
}
},
HotkeyIds = new List<int>
{
0
},
};
return result;