Skip to content

Commit

Permalink
feat: add !config context menu option to open in Explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
Daydreamer-riri committed Mar 22, 2024
1 parent 047fc72 commit 19f89d3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Community.PowerToys.Run.Plugin.WebSearchShortcut/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public List<Result> Query(Query query)
}
return true;
},
ContextData = WebSearchShortcutStorage.GetPath(),
}
];
}
Expand Down Expand Up @@ -188,6 +189,21 @@ public List<Result> Query(Query query)

public List<ContextMenuResult> LoadContextMenus(Result result)
{
if (result?.ContextData is string)
{
return [
new()
{
PluginName = PluginName,
Title = "Open in Explorer (Ctrl + Enter)",
Glyph = "\xe838",
FontFamily = "Segoe Fluent Icons,Segoe MDL2 Assets",
Action = _ => Helper.OpenInShell(Settings.StorageDirectoryPath),
AcceleratorKey = Key.Enter,
AcceleratorModifiers = ModifierKeys.Control,
}
];
}
if (result?.ContextData is null)
{
return [];
Expand Down

0 comments on commit 19f89d3

Please sign in to comment.