Skip to content

Commit 1ddd348

Browse files
committed
feature: show tracking status in Delete Branch panel if possible (#785)
1 parent d616d08 commit 1ddd348

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/ViewModels/DeleteBranch.cs

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

13+
public string TrackStatus
14+
{
15+
get;
16+
private set;
17+
}
18+
1319
public Models.Branch TrackingRemoteBranch
1420
{
1521
get;
@@ -32,6 +38,7 @@ public DeleteBranch(Repository repo, Models.Branch branch)
3238
{
3339
_repo = repo;
3440
Target = branch;
41+
TrackStatus = branch.TrackStatus.ToString();
3542

3643
if (branch.IsLocal && !string.IsNullOrEmpty(branch.Upstream))
3744
{

src/Views/DeleteBranch.axaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
1717
<Path Width="14" Height="14" Margin="8,0" Data="{StaticResource Icons.Branch}"/>
1818
<TextBlock Text="{Binding Target.FriendlyName}"/>
19+
<Border Height="18"
20+
Margin="8,0,0,0"
21+
Padding="8,0"
22+
VerticalAlignment="Center"
23+
CornerRadius="9"
24+
Background="{DynamicResource Brush.Badge}"
25+
IsVisible="{Binding TrackStatus, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
26+
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
27+
FontFamily="{DynamicResource Fonts.Monospace}"
28+
FontSize="10"
29+
Text="{Binding TrackStatus}"/>
30+
</Border>
1931
</StackPanel>
2032

2133
<Border Grid.Row="1" Grid.Column="1" Height="32" IsVisible="{Binding !Target.IsLocal}">

0 commit comments

Comments
 (0)