Skip to content

Commit 19e930e

Browse files
committed
refactor: change hotkeys of commit buttons (#521)
* Ctrl+Shift+Enter to stage all changes then commit * Alt+Enter to commit and push
1 parent 841a009 commit 19e930e

File tree

5 files changed

+15
-29
lines changed

5 files changed

+15
-29
lines changed

src/Resources/Locales/en_US.axaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,7 @@
623623
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT &amp; PUSH</x:String>
624624
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">Template/Histories</x:String>
625625
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">CTRL + Enter</x:String>
626-
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">Use 'Alt+Enter' to stage all changes and commit</x:String>
627-
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage.MacOS" xml:space="preserve">Use '⌥+Enter' to stage all changes and commit</x:String>
626+
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">Use 'Ctrl(⌘)+Shift+Enter' to stage all changes and commit</x:String>
628627
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">CONFLICTS DETECTED</x:String>
629628
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">FILE CONFLICTS ARE RESOLVED</x:String>
630629
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">INCLUDE UNTRACKED FILES</x:String>

src/Resources/Locales/zh_CN.axaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,7 @@
621621
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">提交并推送</x:String>
622622
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">历史输入/模板</x:String>
623623
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">CTRL + Enter</x:String>
624-
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">使用 Alt+Enter 自动暂存所有变更并提交</x:String>
625-
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage.MacOS" xml:space="preserve">使用 ⌥+Enter 自动暂存所有变更并提交</x:String>
624+
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">使用 Ctrl(⌘)+Shift+Enter 自动暂存所有变更并提交</x:String>
626625
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">检测到冲突</x:String>
627626
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">文件冲突已解决</x:String>
628627
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">显示未跟踪文件</x:String>

src/Resources/Locales/zh_TW.axaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,7 @@
626626
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">提交並推送</x:String>
627627
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">歷史輸入/範本</x:String>
628628
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">CTRL + Enter</x:String>
629-
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">使用 Alt+Enter 自動暫存全部變更並提交</x:String>
630-
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage.MacOS" xml:space="preserve">使用 ⌥+Enter 自動暫存全部變更並提交</x:String>
629+
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">使用 Ctrl(⌘)+Shift+Enter 自動暫存全部變更並提交</x:String>
631630
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">檢測到衝突</x:String>
632631
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">檔案衝突已解決</x:String>
633632
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">顯示未追蹤檔案</x:String>

src/Views/Hotkeys.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@
103103
<TextBlock Grid.Row="7" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Enter, macOS=⌘+Enter}"/>
104104
<TextBlock Grid.Row="7" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.Commit}" />
105105

106-
<TextBlock Grid.Row="8" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Alt+Enter, macOS=+Enter}"/>
106+
<TextBlock Grid.Row="8" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+⇧+Enter}"/>
107107
<TextBlock Grid.Row="8" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.CommitWithAutoStage}" />
108108

109-
<TextBlock Grid.Row="9" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+⇧+Enter}"/>
109+
<TextBlock Grid.Row="9" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Alt+Enter, macOS=+Enter}"/>
110110
<TextBlock Grid.Row="9" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Repo.CommitAndPush}" />
111111

112112
<TextBlock Grid.Row="10" Grid.Column="0" Classes="primary bold" Text="F5"/>

src/Views/WorkingCopy.axaml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -226,32 +226,21 @@
226226
ToolTip.Placement="Top"
227227
ToolTip.VerticalOffset="0">
228228
<ToolTip.Tip>
229-
<StackPanel Orientation="Vertical">
230-
<TextBlock Text="{OnPlatform Ctrl+Enter, macOS=⌘+Enter}"/>
231-
<TextBlock Classes="small italic"
232-
Margin="0,4,0,0"
233-
Foreground="{DynamicResource Brush.FG2}">
234-
<TextBlock.Text>
235-
<OnPlatform>
236-
<On Options="Windows, Linux">
237-
<DynamicResource ResourceKey="Text.WorkingCopy.CommitWithAutoStage"/>
238-
</On>
239-
<On Options="macOS">
240-
<DynamicResource ResourceKey="Text.WorkingCopy.CommitWithAutoStage.MacOS"/>
241-
</On>
242-
</OnPlatform>
243-
</TextBlock.Text>
244-
</TextBlock>
245-
</StackPanel>
229+
<TextBlock TextWrapping="Wrap" TextAlignment="Left">
230+
<Run Text="{OnPlatform Ctrl+Enter, macOS=⌘+Enter}"/>
231+
<Run Foreground="{DynamicResource Brush.FG2}"
232+
FontSize="12"
233+
Text="{DynamicResource Text.WorkingCopy.CommitWithAutoStage}"/>
234+
</TextBlock>
246235
</ToolTip.Tip>
247236
</Button>
248237

249-
<!-- Invisible button just to add another hotkey `Alt+Enter/⌥+Enter` to commit with auto-stage -->
238+
<!-- Invisible button just to add another hotkey `Ctrl+Shift+Enter` to commit with auto-stage -->
250239
<Button Grid.Column="7"
251240
Width="0" Height="0"
252241
Background="Transparent"
253242
Command="{Binding CommitWithAutoStage}"
254-
HotKey="Alt+Enter"/>
243+
HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"/>
255244

256245
<Button Grid.Column="8"
257246
Classes="flat"
@@ -260,8 +249,8 @@
260249
Margin="8,0,0,0"
261250
Padding="8,0"
262251
Command="{Binding CommitWithPush}"
263-
HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"
264-
ToolTip.Tip="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"
252+
HotKey="Alt+Enter"
253+
ToolTip.Tip="{OnPlatform Alt+Enter, macOS=+Enter}"
265254
ToolTip.Placement="Top"
266255
ToolTip.VerticalOffset="0"
267256
IsVisible="{Binding IsCommitWithPushVisible}"/>

0 commit comments

Comments
 (0)