Skip to content

Commit f73e3d5

Browse files
Only show target folder context menu for .lnk files
1 parent ec7ecfa commit f73e3d5

File tree

1 file changed

+18
-12
lines changed
  • Plugins/Flow.Launcher.Plugin.Program/Programs

1 file changed

+18
-12
lines changed

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,22 +267,28 @@ public List<Result> ContextMenus(IPublicAPI api)
267267
IcoPath = "Images/folder.png",
268268
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe838"),
269269
},
270-
new Result
271-
{
272-
Title = api.GetTranslation("flowlauncher_plugin_program_open_target_folder"),
273-
Action = _ =>
274-
{
275-
Main.Context.API.OpenDirectory(Path.GetDirectoryName(ExecutablePath), ExecutablePath);
276-
277-
return true;
278-
},
279-
IcoPath = "Images/folder.png",
280-
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe8de"),
281-
},
282270
};
271+
if (Extension(FullPath) == ShortcutExtension)
272+
{
273+
contextMenus.Add(OpenTargetFolderContextMenuResult(api));
274+
}
283275
return contextMenus;
284276
}
285277

278+
private Result OpenTargetFolderContextMenuResult(IPublicAPI api)
279+
{
280+
return new Result
281+
{
282+
Title = api.GetTranslation("flowlauncher_plugin_program_open_target_folder"),
283+
Action = _ =>
284+
{
285+
api.OpenDirectory(Path.GetDirectoryName(ExecutablePath), ExecutablePath);
286+
return true;
287+
},
288+
IcoPath = "Images/folder.png",
289+
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe8de"),
290+
};
291+
}
286292

287293
public override string ToString()
288294
{

0 commit comments

Comments
 (0)