Skip to content

Commit c5e30e8

Browse files
committed
feature: add repository page hotkey Ctrl+E/⌘+E to open in file browser
Signed-off-by: leo <longshuang@msn.cn>
1 parent 671635d commit c5e30e8

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

src/Views/Hotkeys.axaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
FontSize="{Binding Source={x:Static vm:Preferences.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Increase}}"
9090
Margin="0,8"/>
9191

92-
<Grid RowDefinitions="20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20" ColumnDefinitions="150,*">
92+
<Grid RowDefinitions="20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20" ColumnDefinitions="150,*">
9393
<TextBlock Grid.Row="0" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+Shift+H, macOS=⌘+⇧+H}"/>
9494
<TextBlock Grid.Row="0" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.GoHome}" />
9595

@@ -125,21 +125,24 @@
125125

126126
<TextBlock Grid.Row="11" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+Shift+Up, macOS=⌘+⇧+Up}"/>
127127
<TextBlock Grid.Row="11" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.Push}" />
128-
128+
129129
<TextBlock Grid.Row="12" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+Shift+P, macOS=⌘+⇧+P}"/>
130130
<TextBlock Grid.Row="12" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.OpenCommandPalette}" />
131131

132-
<TextBlock Grid.Row="13" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+J, macOS=⌘+J}"/>
133-
<TextBlock Grid.Row="13" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.ToggleHistoriesDetailPanel}" />
134-
135-
<TextBlock Grid.Row="14" Grid.Column="0" Classes="bold" Text="{OnPlatform Alt+Down, macOS=⌥+Down}"/>
136-
<TextBlock Grid.Row="14" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.GoToParent}" />
132+
<TextBlock Grid.Row="13" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+E, macOS=⌘+E}"/>
133+
<TextBlock Grid.Row="13" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Repository.Explore}" />
134+
135+
<TextBlock Grid.Row="14" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+J, macOS=⌘+J}"/>
136+
<TextBlock Grid.Row="14" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.ToggleHistoriesDetailPanel}" />
137137

138-
<TextBlock Grid.Row="15" Grid.Column="0" Classes="bold" Text="{OnPlatform Alt+Up, macOS=⌥+Up}"/>
139-
<TextBlock Grid.Row="15" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.GoToChild}" />
138+
<TextBlock Grid.Row="15" Grid.Column="0" Classes="bold" Text="{OnPlatform Alt+Down, macOS=⌥+Down}"/>
139+
<TextBlock Grid.Row="15" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.GoToParent}" />
140140

141-
<TextBlock Grid.Row="16" Grid.Column="0" Classes="bold" Text="F5"/>
142-
<TextBlock Grid.Row="16" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.Refresh}" />
141+
<TextBlock Grid.Row="16" Grid.Column="0" Classes="bold" Text="{OnPlatform Alt+Up, macOS=⌥+Up}"/>
142+
<TextBlock Grid.Row="16" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.GoToChild}" />
143+
144+
<TextBlock Grid.Row="17" Grid.Column="0" Classes="bold" Text="F5"/>
145+
<TextBlock Grid.Row="17" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.Refresh}" />
143146
</Grid>
144147
</StackPanel>
145148
</Border>

src/Views/Launcher.axaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ protected override async void OnKeyDown(KeyEventArgs e)
301301
repo.ShowPopup(new ViewModels.CreateTag(repo, tc));
302302
e.Handled = true;
303303
return;
304+
case Key.E:
305+
Native.OS.OpenInFileManager(repo.FullPath);
306+
e.Handled = true;
307+
return;
304308
}
305309
}
306310
}

0 commit comments

Comments
 (0)