Only show target folder context menu for .lnk files

This commit is contained in:
VictoriousRaptor 2024-03-31 01:17:59 +08:00
parent ec7ecfacd0
commit f73e3d57d6

View file

@ -267,22 +267,28 @@ namespace Flow.Launcher.Plugin.Program.Programs
IcoPath = "Images/folder.png",
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe838"),
},
new Result
{
Title = api.GetTranslation("flowlauncher_plugin_program_open_target_folder"),
Action = _ =>
{
Main.Context.API.OpenDirectory(Path.GetDirectoryName(ExecutablePath), ExecutablePath);
return true;
},
IcoPath = "Images/folder.png",
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe8de"),
},
};
if (Extension(FullPath) == ShortcutExtension)
{
contextMenus.Add(OpenTargetFolderContextMenuResult(api));
}
return contextMenus;
}
private Result OpenTargetFolderContextMenuResult(IPublicAPI api)
{
return new Result
{
Title = api.GetTranslation("flowlauncher_plugin_program_open_target_folder"),
Action = _ =>
{
api.OpenDirectory(Path.GetDirectoryName(ExecutablePath), ExecutablePath);
return true;
},
IcoPath = "Images/folder.png",
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe8de"),
};
}
public override string ToString()
{