Explorer plugin native context menu: move native context menu below all other items

This commit is contained in:
Yusyuriv 2024-06-07 13:34:48 +06:00
parent adebabd824
commit 1747a64d6b
No known key found for this signature in database
GPG key ID: A91C52E6F73148E0

View file

@ -167,24 +167,6 @@ namespace Flow.Launcher.Plugin.Explorer
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\uf12b")
});
if (record.Type is ResultType.File or ResultType.Folder)
{
var menuItems = ShellContextMenuDisplayHelper.GetContextMenuWithIcons(record.FullPath);
foreach (var menuItem in menuItems)
{
contextMenus.Add(new Result
{
Title = menuItem.Label,
Icon = () => menuItem.Icon,
Action = _ =>
{
ShellContextMenuDisplayHelper.ExecuteContextMenuItem(record.FullPath, menuItem.CommandId);
return true;
}
});
}
}
if (record.Type is ResultType.File or ResultType.Folder)
contextMenus.Add(new Result
@ -297,6 +279,24 @@ namespace Flow.Launcher.Plugin.Explorer
},
IcoPath = Constants.DifferentUserIconImagePath
});
if (record.Type is ResultType.File or ResultType.Folder)
{
var menuItems = ShellContextMenuDisplayHelper.GetContextMenuWithIcons(record.FullPath);
foreach (var menuItem in menuItems)
{
contextMenus.Add(new Result
{
Title = menuItem.Label,
Icon = () => menuItem.Icon,
Action = _ =>
{
ShellContextMenuDisplayHelper.ExecuteContextMenuItem(record.FullPath, menuItem.CommandId);
return true;
}
});
}
}
}
return contextMenus;