diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 633af7b6ba2..eabd118fb33 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -140,6 +140,29 @@ public List LoadContextMenus(Result selectedResult) Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue8c8") }); + contextMenus.Add(new Result + { + Title = Context.API.GetTranslation("plugin_explorer_copyname"), + SubTitle = Context.API.GetTranslation("plugin_explorer_copyname_subtitle"), + Action = _ => + { + try + { + Context.API.CopyToClipboard(Path.GetFileName(record.FullPath)); + return true; + } + catch (Exception e) + { + var message = "Fail to set text in clipboard"; + LogException(message, e); + Context.API.ShowMsg(message); + return false; + } + }, + IcoPath = Constants.CopyImagePath, + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue8c8") + }); + contextMenus.Add(new Result { Title = Context.API.GetTranslation("plugin_explorer_copyfilefolder"), diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index f7d5bdb18e4..79f8a5848ec 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -82,6 +82,8 @@ Copy path Copy path of current item to clipboard + Copy name + Copy name of current item to clipboard Copy Copy current file to clipboard Copy current folder to clipboard diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs index e4056131d4b..1c5d074a0b8 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs @@ -8,7 +8,6 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -using System.Windows; using System.Windows.Controls; using Flow.Launcher.Plugin.Explorer.Exceptions;