mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
feature: show track status in Delete Multiple Branches
panel (#785)
This commit is contained in:
parent
1ddd348a40
commit
75e9f1e9a4
4 changed files with 18 additions and 10 deletions
|
@ -7,6 +7,8 @@ namespace SourceGit.Models
|
||||||
public List<string> Ahead { get; set; } = new List<string>();
|
public List<string> Ahead { get; set; } = new List<string>();
|
||||||
public List<string> Behind { get; set; } = new List<string>();
|
public List<string> Behind { get; set; } = new List<string>();
|
||||||
|
|
||||||
|
public bool IsVisible => Ahead.Count > 0 || Behind.Count > 0;
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
if (Ahead.Count == 0 && Behind.Count == 0)
|
if (Ahead.Count == 0 && Behind.Count == 0)
|
||||||
|
|
|
@ -10,12 +10,6 @@ namespace SourceGit.ViewModels
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string TrackStatus
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
private set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Models.Branch TrackingRemoteBranch
|
public Models.Branch TrackingRemoteBranch
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
|
@ -38,7 +32,6 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
Target = branch;
|
Target = branch;
|
||||||
TrackStatus = branch.TrackStatus.ToString();
|
|
||||||
|
|
||||||
if (branch.IsLocal && !string.IsNullOrEmpty(branch.Upstream))
|
if (branch.IsLocal && !string.IsNullOrEmpty(branch.Upstream))
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
CornerRadius="9"
|
CornerRadius="9"
|
||||||
Background="{DynamicResource Brush.Badge}"
|
Background="{DynamicResource Brush.Badge}"
|
||||||
IsVisible="{Binding TrackStatus, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
|
IsVisible="{Binding Target.TrackStatus.IsVisible}">
|
||||||
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
|
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
|
||||||
FontFamily="{DynamicResource Fonts.Monospace}"
|
FontFamily="{DynamicResource Fonts.Monospace}"
|
||||||
FontSize="10"
|
FontSize="10"
|
||||||
Text="{Binding TrackStatus}"/>
|
Text="{Binding Target.TrackStatus}"/>
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,22 @@
|
||||||
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate DataType="m:Branch">
|
<DataTemplate DataType="m:Branch">
|
||||||
<Grid Height="26" ColumnDefinitions="22,*">
|
<Grid Height="26" ColumnDefinitions="22,*,Auto">
|
||||||
<Path Grid.Column="0" Width="10" Height="10" Margin="4,0,8,0" Data="{StaticResource Icons.Branch}" />
|
<Path Grid.Column="0" Width="10" Height="10" Margin="4,0,8,0" Data="{StaticResource Icons.Branch}" />
|
||||||
<TextBlock Grid.Column="1" Text="{Binding FriendlyName}" Classes="primary" />
|
<TextBlock Grid.Column="1" Text="{Binding FriendlyName}" Classes="primary" />
|
||||||
|
<Border Grid.Column="2"
|
||||||
|
Height="18"
|
||||||
|
Margin="8,0"
|
||||||
|
Padding="8,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
CornerRadius="9"
|
||||||
|
Background="{DynamicResource Brush.Badge}"
|
||||||
|
IsVisible="{Binding TrackStatus.IsVisible}">
|
||||||
|
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
|
||||||
|
FontFamily="{DynamicResource Fonts.Monospace}"
|
||||||
|
FontSize="10"
|
||||||
|
Text="{Binding TrackStatus}"/>
|
||||||
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
|
|
Loading…
Reference in a new issue