Skip to content

Commit 75e9f1e

Browse files
committed
feature: show track status in Delete Multiple Branches panel (#785)
1 parent 1ddd348 commit 75e9f1e

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

src/Models/Branch.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ public class BranchTrackStatus
77
public List<string> Ahead { get; set; } = new List<string>();
88
public List<string> Behind { get; set; } = new List<string>();
99

10+
public bool IsVisible => Ahead.Count > 0 || Behind.Count > 0;
11+
1012
public override string ToString()
1113
{
1214
if (Ahead.Count == 0 && Behind.Count == 0)

src/ViewModels/DeleteBranch.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ public Models.Branch Target
1010
private set;
1111
}
1212

13-
public string TrackStatus
14-
{
15-
get;
16-
private set;
17-
}
18-
1913
public Models.Branch TrackingRemoteBranch
2014
{
2115
get;
@@ -38,7 +32,6 @@ public DeleteBranch(Repository repo, Models.Branch branch)
3832
{
3933
_repo = repo;
4034
Target = branch;
41-
TrackStatus = branch.TrackStatus.ToString();
4235

4336
if (branch.IsLocal && !string.IsNullOrEmpty(branch.Upstream))
4437
{

src/Views/DeleteBranch.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
VerticalAlignment="Center"
2323
CornerRadius="9"
2424
Background="{DynamicResource Brush.Badge}"
25-
IsVisible="{Binding TrackStatus, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
25+
IsVisible="{Binding Target.TrackStatus.IsVisible}">
2626
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
2727
FontFamily="{DynamicResource Fonts.Monospace}"
2828
FontSize="10"
29-
Text="{Binding TrackStatus}"/>
29+
Text="{Binding Target.TrackStatus}"/>
3030
</Border>
3131
</StackPanel>
3232

src/Views/DeleteMultipleBranches.axaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,22 @@
4242

4343
<ListBox.ItemTemplate>
4444
<DataTemplate DataType="m:Branch">
45-
<Grid Height="26" ColumnDefinitions="22,*">
45+
<Grid Height="26" ColumnDefinitions="22,*,Auto">
4646
<Path Grid.Column="0" Width="10" Height="10" Margin="4,0,8,0" Data="{StaticResource Icons.Branch}" />
4747
<TextBlock Grid.Column="1" Text="{Binding FriendlyName}" Classes="primary" />
48+
<Border Grid.Column="2"
49+
Height="18"
50+
Margin="8,0"
51+
Padding="8,0"
52+
VerticalAlignment="Center"
53+
CornerRadius="9"
54+
Background="{DynamicResource Brush.Badge}"
55+
IsVisible="{Binding TrackStatus.IsVisible}">
56+
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
57+
FontFamily="{DynamicResource Fonts.Monospace}"
58+
FontSize="10"
59+
Text="{Binding TrackStatus}"/>
60+
</Border>
4861
</Grid>
4962
</DataTemplate>
5063
</ListBox.ItemTemplate>

0 commit comments

Comments
 (0)