File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
Plugins/Flow.Launcher.Plugin.Explorer Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,29 @@ public List<Result> LoadContextMenus(Result selectedResult)
140140 Glyph = new GlyphInfo ( FontFamily : "/Resources/#Segoe Fluent Icons" , Glyph : "\ue8c8 " )
141141 } ) ;
142142
143+ contextMenus . Add ( new Result
144+ {
145+ Title = Context . API . GetTranslation ( "plugin_explorer_copyname" ) ,
146+ SubTitle = Context . API . GetTranslation ( "plugin_explorer_copyname_subtitle" ) ,
147+ Action = _ =>
148+ {
149+ try
150+ {
151+ Context . API . CopyToClipboard ( Path . GetFileName ( record . FullPath ) ) ;
152+ return true ;
153+ }
154+ catch ( Exception e )
155+ {
156+ var message = "Fail to set text in clipboard" ;
157+ LogException ( message , e ) ;
158+ Context . API . ShowMsg ( message ) ;
159+ return false ;
160+ }
161+ } ,
162+ IcoPath = Constants . CopyImagePath ,
163+ Glyph = new GlyphInfo ( FontFamily : "/Resources/#Segoe Fluent Icons" , Glyph : "\ue8c8 " )
164+ } ) ;
165+
143166 contextMenus . Add ( new Result
144167 {
145168 Title = Context . API . GetTranslation ( "plugin_explorer_copyfilefolder" ) ,
Original file line number Diff line number Diff line change 8282 <!-- Context menu items -->
8383 <system : String x : Key =" plugin_explorer_copypath" >Copy path</system : String >
8484 <system : String x : Key =" plugin_explorer_copypath_subtitle" >Copy path of current item to clipboard</system : String >
85+ <system : String x : Key =" plugin_explorer_copyname" >Copy name</system : String >
86+ <system : String x : Key =" plugin_explorer_copyname_subtitle" >Copy name of current item to clipboard</system : String >
8587 <system : String x : Key =" plugin_explorer_copyfilefolder" >Copy</system : String >
8688 <system : String x : Key =" plugin_explorer_copyfile_subtitle" >Copy current file to clipboard</system : String >
8789 <system : String x : Key =" plugin_explorer_copyfolder_subtitle" >Copy current folder to clipboard</system : String >
Original file line number Diff line number Diff line change 88using System . IO ;
99using System . Threading ;
1010using System . Threading . Tasks ;
11- using System . Windows ;
1211using System . Windows . Controls ;
1312using Flow . Launcher . Plugin . Explorer . Exceptions ;
1413
You can’t perform that action at this time.
0 commit comments