Skip to content

Commit f9ff020

Browse files
committed
feat: add push hotkey
- Update hotkey display for repository push to support both single and modified key combinations. - Add a hidden button with a hotkey for pushing changes. - Add a hotkey handler for pushing changes without force.
1 parent 2a3490b commit f9ff020

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/Views/Hotkeys.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<TextBlock Grid.Row="9" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+Shift+Down, macOS=⌘+⇧+Down}"/>
115115
<TextBlock Grid.Row="9" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.Pull}" />
116116

117-
<TextBlock Grid.Row="10" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+Shift+Up, macOS=⌘+⇧+Up}"/>
117+
<TextBlock Grid.Row="10" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+Up/Ctrl+Shift+Up, macOS=⌘+Up/⌘+⇧+Up}"/>
118118
<TextBlock Grid.Row="10" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.Push}" />
119119

120120
<TextBlock Grid.Row="11" Grid.Column="0" Classes="bold" Text="{OnPlatform Ctrl+Shift+P, macOS=⌘+⇧+P}"/>

src/Views/RepositoryToolbar.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161

6262
<Path Width="14" Height="14" Data="{StaticResource Icons.Push}"/>
6363
</Button>
64+
<Button Width="0" Height="0" Click="PushByHotKey" IsVisible="False" HotKey="{OnPlatform Ctrl+Up, macOS=⌘+Up}"/>
6465
<Button Width="0" Height="0" Click="PushDirectlyByHotKey" IsVisible="False" HotKey="{OnPlatform Ctrl+Shift+Up, macOS=⌘+Shift+Up}"/>
6566

6667
<Button Classes="icon_button" Width="32" Margin="16,0,0,0" Tapped="StashAll" IsVisible="{Binding !IsBare}">

src/Views/RepositoryToolbar.axaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,15 @@ private async void Push(object sender, TappedEventArgs e)
197197
}
198198
}
199199

200+
private async void PushByHotKey(object sender, RoutedEventArgs e)
201+
{
202+
if (DataContext is ViewModels.Repository repo)
203+
{
204+
await repo.PushAsync(false);
205+
e.Handled = true;
206+
}
207+
}
208+
200209
private async void PushDirectlyByHotKey(object sender, RoutedEventArgs e)
201210
{
202211
if (DataContext is ViewModels.Repository repo)

0 commit comments

Comments
 (0)