Skip to content

Commit eced2e0

Browse files
committed
ux: show tips if user is about to delete a remote branch (#99)
1 parent 5964cf2 commit eced2e0

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

src/Resources/Locales/en_US.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
<x:String x:Key="Text.Cut" xml:space="preserve">Cut</x:String>
121121
<x:String x:Key="Text.DeleteBranch" xml:space="preserve">Delete Branch</x:String>
122122
<x:String x:Key="Text.DeleteBranch.Branch" xml:space="preserve">Branch :</x:String>
123+
<x:String x:Key="Text.DeleteBranch.IsRemoteTip" xml:space="preserve">You are about to delete a remote branch!!!</x:String>
123124
<x:String x:Key="Text.DeleteRemote" xml:space="preserve">Delete Remote</x:String>
124125
<x:String x:Key="Text.DeleteRemote.Remote" xml:space="preserve">Remote :</x:String>
125126
<x:String x:Key="Text.DeleteRepositoryNode.Target" xml:space="preserve">Target :</x:String>

src/Resources/Locales/zh_CN.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
<x:String x:Key="Text.Cut" xml:space="preserve">剪切</x:String>
121121
<x:String x:Key="Text.DeleteBranch" xml:space="preserve">删除分支确认</x:String>
122122
<x:String x:Key="Text.DeleteBranch.Branch" xml:space="preserve">分支名 :</x:String>
123+
<x:String x:Key="Text.DeleteBranch.IsRemoteTip" xml:space="preserve">您正在删除远程上的分支,请务必小心!!!</x:String>
123124
<x:String x:Key="Text.DeleteRemote" xml:space="preserve">删除远程确认</x:String>
124125
<x:String x:Key="Text.DeleteRemote.Remote" xml:space="preserve">远程名 :</x:String>
125126
<x:String x:Key="Text.DeleteRepositoryNode.Target" xml:space="preserve">目标 :</x:String>

src/Views/DeleteBranch.axaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@
1111
<TextBlock FontSize="18"
1212
Classes="bold"
1313
Text="{DynamicResource Text.DeleteBranch}"/>
14-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,16,0,0">
15-
<TextBlock Text="{DynamicResource Text.DeleteBranch.Branch}"/>
16-
<Path Width="14" Height="14" Margin="8,0" Data="{StaticResource Icons.Branch}"/>
17-
<TextBlock Text="{Binding Target, Converter={x:Static c:BranchConverters.ToName}}"/>
18-
</StackPanel>
14+
15+
<Grid Margin="0,16,8,0" RowDefinitions="32,Auto" ColumnDefinitions="150,*">
16+
<TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" Text="{DynamicResource Text.DeleteBranch.Branch}"/>
17+
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
18+
<Path Width="14" Height="14" Margin="8,0" Data="{StaticResource Icons.Branch}"/>
19+
<TextBlock Text="{Binding Target, Converter={x:Static c:BranchConverters.ToName}}"/>
20+
</StackPanel>
21+
22+
<Border Grid.Row="1" Grid.Column="1" Height="32" IsVisible="{Binding !Target.IsLocal}">
23+
<TextBlock Margin="8,0"
24+
Text="{DynamicResource Text.DeleteBranch.IsRemoteTip}"
25+
Foreground="{DynamicResource Brush.FG2}"
26+
FontStyle="Italic"
27+
VerticalAlignment="Center"/>
28+
</Border>
29+
</Grid>
1930
</StackPanel>
2031
</UserControl>

0 commit comments

Comments
 (0)