Skip to content

Commit 0e2bb1b

Browse files
committed
feature: show commit changes count (#1306)
Signed-off-by: leo <[email protected]>
1 parent 57ee1f7 commit 0e2bb1b

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

src/Resources/Locales/en_US.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
<x:String x:Key="Text.CommitCM.Squash" xml:space="preserve">Squash into Parent</x:String>
125125
<x:String x:Key="Text.CommitCM.SquashCommitsSinceThis" xml:space="preserve">Squash Children into Here</x:String>
126126
<x:String x:Key="Text.CommitDetail.Changes" xml:space="preserve">CHANGES</x:String>
127+
<x:String x:Key="Text.CommitDetail.Changes.Count" xml:space="preserve">{0} changed file(s)</x:String>
127128
<x:String x:Key="Text.CommitDetail.Changes.Search" xml:space="preserve">Search Changes...</x:String>
128129
<x:String x:Key="Text.CommitDetail.Files" xml:space="preserve">FILES</x:String>
129130
<x:String x:Key="Text.CommitDetail.Files.LFS" xml:space="preserve">LFS File</x:String>

src/Resources/Locales/zh_CN.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
<x:String x:Key="Text.CommitCM.Squash" xml:space="preserve">合并此提交到上一个提交</x:String>
129129
<x:String x:Key="Text.CommitCM.SquashCommitsSinceThis" xml:space="preserve">合并之后的提交到此处</x:String>
130130
<x:String x:Key="Text.CommitDetail.Changes" xml:space="preserve">变更对比</x:String>
131+
<x:String x:Key="Text.CommitDetail.Changes.Count" xml:space="preserve">{0} 个文件发生变更</x:String>
131132
<x:String x:Key="Text.CommitDetail.Changes.Search" xml:space="preserve">查找变更...</x:String>
132133
<x:String x:Key="Text.CommitDetail.Files" xml:space="preserve">文件列表</x:String>
133134
<x:String x:Key="Text.CommitDetail.Files.LFS" xml:space="preserve">LFS文件</x:String>

src/Resources/Locales/zh_TW.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
<x:String x:Key="Text.CommitCM.Squash" xml:space="preserve">合併此提交到上一個提交</x:String>
129129
<x:String x:Key="Text.CommitCM.SquashCommitsSinceThis" xml:space="preserve">合併之後的提交到此處</x:String>
130130
<x:String x:Key="Text.CommitDetail.Changes" xml:space="preserve">變更對比</x:String>
131+
<x:String x:Key="Text.CommitDetail.Changes.Count" xml:space="preserve">更改了 {0} 個檔案</x:String>
131132
<x:String x:Key="Text.CommitDetail.Changes.Search" xml:space="preserve">搜尋變更...</x:String>
132133
<x:String x:Key="Text.CommitDetail.Files" xml:space="preserve">檔案列表</x:String>
133134
<x:String x:Key="Text.CommitDetail.Files.LFS" xml:space="preserve">LFS 檔案</x:String>

src/Views/CommitChanges.axaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:vm="using:SourceGit.ViewModels"
66
xmlns:v="using:SourceGit.Views"
7+
xmlns:c="using:SourceGit.Converters"
78
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
89
x:Class="SourceGit.Views.CommitChanges"
910
x:DataType="vm:CommitDetail">
@@ -14,7 +15,7 @@
1415
<ColumnDefinition Width="*" MinWidth="100"/>
1516
</Grid.ColumnDefinitions>
1617

17-
<Grid Grid.Column="0" RowDefinitions="26,*">
18+
<Grid Grid.Column="0" RowDefinitions="26,*,26">
1819
<!-- Search & Display Mode -->
1920
<Grid Grid.Row="0" ColumnDefinitions="*,Auto">
2021
<TextBox Grid.Column="0"
@@ -52,6 +53,14 @@
5253
AutoSelectFirstChange="True"
5354
ContextRequested="OnChangeContextRequested"/>
5455
</Border>
56+
57+
<!-- Summary -->
58+
<Border Grid.Row="2" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1,0,1,1" Background="Transparent">
59+
<TextBlock Margin="4,0,0,0"
60+
Foreground="{DynamicResource Brush.FG2}"
61+
Text="{Binding Changes.Count, Converter={x:Static c:StringConverters.FormatByResourceKey}, ConverterParameter='CommitDetail.Changes.Count'}"
62+
HorizontalAlignment="Left" VerticalAlignment="Center"/>
63+
</Border>
5564
</Grid>
5665

5766
<GridSplitter Grid.Column="1"

0 commit comments

Comments
 (0)