14
14
using System . Threading . Channels ;
15
15
using System . Xml ;
16
16
using Windows . ApplicationModel . Core ;
17
+ using System . Windows . Input ;
17
18
18
19
namespace Flow . Launcher . Plugin . Program . Programs
19
20
{
@@ -422,12 +423,16 @@ public Result Result(string query, IPublicAPI api)
422
423
ContextData = this ,
423
424
Action = e =>
424
425
{
425
- var elevated = (
426
- e . SpecialKeyState . CtrlPressed &&
427
- e . SpecialKeyState . ShiftPressed &&
428
- ! e . SpecialKeyState . AltPressed &&
429
- ! e . SpecialKeyState . WinPressed
430
- ) ;
426
+ // Ctrl + Enter to open containing folder
427
+ bool openFolder = e . SpecialKeyState . ToModifierKeys ( ) == ModifierKeys . Control ;
428
+ if ( openFolder )
429
+ {
430
+ Main . Context . API . OpenDirectory ( Location ) ;
431
+ return true ;
432
+ }
433
+
434
+ // Ctrl + Shift + Enter to run elevated
435
+ bool elevated = e . SpecialKeyState . ToModifierKeys ( ) == ( ModifierKeys . Control | ModifierKeys . Shift ) ;
431
436
432
437
bool shouldRunElevated = elevated && CanRunElevated ;
433
438
_ = Task . Run ( ( ) => Launch ( shouldRunElevated ) ) . ConfigureAwait ( false ) ;
@@ -459,7 +464,8 @@ public List<Result> ContextMenus(IPublicAPI api)
459
464
460
465
return true ;
461
466
} ,
462
- IcoPath = "Images/folder.png"
467
+ IcoPath = "Images/folder.png" ,
468
+ Glyph = new GlyphInfo ( FontFamily : "/Resources/#Segoe Fluent Icons" , Glyph : "\xe838 " ) ,
463
469
}
464
470
} ;
465
471
@@ -473,7 +479,8 @@ public List<Result> ContextMenus(IPublicAPI api)
473
479
Task . Run ( ( ) => Launch ( true ) ) . ConfigureAwait ( false ) ;
474
480
return true ;
475
481
} ,
476
- IcoPath = "Images/cmd.png"
482
+ IcoPath = "Images/cmd.png" ,
483
+ Glyph = new GlyphInfo ( FontFamily : "/Resources/#Segoe Fluent Icons" , Glyph : "\xe7ef " )
477
484
} ) ;
478
485
}
479
486
0 commit comments