@@ -5,13 +5,14 @@ namespace SourceGit.ViewModels
55{
66 public class RepositoryCommandPaletteCmd
77 {
8- public string Key { get ; set ; }
8+ public string Label { get ; set ; }
9+ public string Icon { get ; set ; }
910 public Action Action { get ; set ; }
10- public string Label => $ "{ App . Text ( Key ) } ...";
1111
12- public RepositoryCommandPaletteCmd ( string key , Action action )
12+ public RepositoryCommandPaletteCmd ( string label , string icon , Action action )
1313 {
14- Key = key ;
14+ Label = label ;
15+ Icon = icon ;
1516 Action = action ;
1617 }
1718 }
@@ -45,37 +46,37 @@ public RepositoryCommandPalette(Launcher launcher, Repository repo)
4546 _launcher = launcher ;
4647 _repo = repo ;
4748
48- _cmds . Add ( new ( "Blame" , ( ) =>
49+ _cmds . Add ( new ( $ " { App . Text ( "Blame" ) } ..." , "Blame" , ( ) =>
4950 {
5051 var sub = new BlameCommandPalette ( _launcher , _repo . FullPath ) ;
5152 _launcher . OpenCommandPalette ( sub ) ;
5253 } ) ) ;
5354
54- _cmds . Add ( new ( " Checkout", ( ) =>
55+ _cmds . Add ( new ( $ " { App . Text ( " Checkout" ) } ..." , "Check ", ( ) =>
5556 {
5657 var sub = new CheckoutCommandPalette ( _launcher , _repo ) ;
5758 _launcher . OpenCommandPalette ( sub ) ;
5859 } ) ) ;
5960
60- _cmds . Add ( new ( " Compare.WithHead", ( ) =>
61+ _cmds . Add ( new ( $ " { App . Text ( " Compare.WithHead" ) } ..." , "Compare ", ( ) =>
6162 {
6263 var sub = new CompareCommandPalette ( _launcher , _repo , _repo . CurrentBranch ) ;
6364 _launcher . OpenCommandPalette ( sub ) ;
6465 } ) ) ;
6566
66- _cmds . Add ( new ( " FileHistory", ( ) =>
67+ _cmds . Add ( new ( $ " { App . Text ( " FileHistory" ) } ..." , "Histories ", ( ) =>
6768 {
6869 var sub = new FileHistoryCommandPalette ( _launcher , _repo . FullPath ) ;
6970 _launcher . OpenCommandPalette ( sub ) ;
7071 } ) ) ;
7172
72- _cmds . Add ( new ( "Merge" , ( ) =>
73+ _cmds . Add ( new ( $ " { App . Text ( "Merge" ) } ..." , "Merge" , ( ) =>
7374 {
7475 var sub = new MergeCommandPalette ( _launcher , _repo ) ;
7576 _launcher . OpenCommandPalette ( sub ) ;
7677 } ) ) ;
7778
78- _cmds . Add ( new ( " OpenFile", ( ) =>
79+ _cmds . Add ( new ( $ " { App . Text ( " OpenFile" ) } ..." , "OpenWith ", ( ) =>
7980 {
8081 var sub = new OpenFileCommandPalette ( _launcher , _repo . FullPath ) ;
8182 _launcher . OpenCommandPalette ( sub ) ;
@@ -120,8 +121,7 @@ private void UpdateVisible()
120121
121122 foreach ( var cmd in _cmds )
122123 {
123- if ( cmd . Key . Contains ( _filter , StringComparison . OrdinalIgnoreCase ) ||
124- cmd . Label . Contains ( _filter , StringComparison . OrdinalIgnoreCase ) )
124+ if ( cmd . Label . Contains ( _filter , StringComparison . OrdinalIgnoreCase ) )
125125 visible . Add ( cmd ) ;
126126 }
127127
0 commit comments