File tree Expand file tree Collapse file tree
Flow.Launcher.Plugin.OneNote Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ public class IconProvider : BaseModel
3030 public string Warning => settings . IconTheme == IconTheme . Color
3131 ? $ "{ IC . ImagesDirectory } { IC . Warning } .{ GetIconThemeString ( IconTheme . Dark ) } .png"
3232 : GetIconPath ( IC . Warning ) ;
33+ public static GlyphInfo Clipboard { get ; } = new ( "/Resources/#Segoe Fluent Icons" , "\uf0e3 " ) ; // Clipboard
3334
3435 public int CachedIconCount => iconCache . Keys . Count ( k => char . IsDigit ( k . Split ( '.' ) [ 1 ] [ 1 ] ) ) ;
3536 public DirectoryInfo GeneratedImagesDirectoryInfo { get ; }
Original file line number Diff line number Diff line change 11using System ;
2- using System . Collections . Concurrent ;
32using System . Collections . Generic ;
43using System . Linq ;
54using System . Threading . Tasks ;
@@ -313,14 +312,15 @@ public List<Result> ContextMenu(Result selectedResult)
313312 return true ;
314313 }
315314 } ) ;
315+
316316
317317 string autoCompleteText = GetAutoCompleteText ( item ) ;
318318 results . Add ( new Result
319319 {
320320 Title = "Show in Notebook Explorer" ,
321321 SubTitle = autoCompleteText ,
322322 AddSelectedCount = false ,
323- Score = 0 ,
323+ Score = 10 ,
324324 IcoPath = iconProvider . NotebookExplorer ,
325325 Action = _ =>
326326 {
@@ -329,6 +329,20 @@ public List<Result> ContextMenu(Result selectedResult)
329329 return false ;
330330 }
331331 } ) ;
332+
333+ results . Add ( new Result
334+ {
335+ Title = "Copy link to clipboard" ,
336+ Glyph = IconProvider . Clipboard ,
337+ Score = 0 ,
338+ AddSelectedCount = false ,
339+ Action = _ =>
340+ {
341+ OneNoteApp . ComObject . GetHyperlinkToObject ( item . Id , string . Empty , out var hyperlink ) ;
342+ context . API . CopyToClipboard ( hyperlink ) ;
343+ return true ;
344+ }
345+ } ) ;
332346 }
333347 return results ;
334348 }
You can’t perform that action at this time.
0 commit comments