feature: add tooltip for branches (#228)

This commit is contained in:
leo 2024-07-02 10:23:21 +08:00
parent 7965338d7c
commit 4ef0f1180f
No known key found for this signature in database
21 changed files with 54 additions and 48 deletions

View file

@ -1,10 +0,0 @@
using Avalonia.Data.Converters;
namespace SourceGit.Converters
{
public static class BranchConverters
{
public static readonly FuncValueConverter<Models.Branch, string> ToName =
new FuncValueConverter<Models.Branch, string>(v => v.IsLocal ? v.Name : $"{v.Remote}/{v.Name}");
}
}

View file

@ -11,5 +11,7 @@
public string UpstreamTrackStatus { get; set; } public string UpstreamTrackStatus { get; set; }
public string Remote { get; set; } public string Remote { get; set; }
public bool IsHead { get; set; } public bool IsHead { get; set; }
public string FriendlyName => IsLocal ? Name : $"{Remote}/{Name}";
} }
} }

View file

@ -71,7 +71,7 @@ namespace SourceGit.ViewModels
if (branch.IsLocal) if (branch.IsLocal)
LocalBranches.Add(branch.Name); LocalBranches.Add(branch.Name);
else else
RemoteBranches.Add($"{branch.Remote}/{branch.Name}"); RemoteBranches.Add(branch.FriendlyName);
} }
if (RemoteBranches.Count > 0) if (RemoteBranches.Count > 0)

View file

@ -69,6 +69,17 @@ namespace SourceGit.ViewModels
set => SetProperty(ref _isSelected, value); set => SetProperty(ref _isSelected, value);
} }
public string Tooltip
{
get
{
if (Backend is Models.Branch b)
return b.FriendlyName;
return null;
}
}
public CornerRadius CornerRadius public CornerRadius CornerRadius
{ {
get => _cornerRadius; get => _cornerRadius;

View file

@ -72,8 +72,7 @@ namespace SourceGit.ViewModels
foreach (var b in creator._repo.Branches) foreach (var b in creator._repo.Branches)
{ {
var test = b.IsLocal ? b.Name : $"{b.Remote}/{b.Name}"; if (b.FriendlyName == name)
if (test == name)
return new ValidationResult("A branch with same name already exists!"); return new ValidationResult("A branch with same name already exists!");
} }

View file

@ -35,9 +35,8 @@ namespace SourceGit.ViewModels
if (branch.IsLocal && !string.IsNullOrEmpty(branch.Upstream)) if (branch.IsLocal && !string.IsNullOrEmpty(branch.Upstream))
{ {
var upstream = branch.Upstream.Substring(13); TrackingRemoteBranch = repo.Branches.Find(x => x.FullName == branch.Upstream);
TrackingRemoteBranch = repo.Branches.Find(x => !x.IsLocal && $"{x.Remote}/{x.Name}" == upstream); DeleteTrackingRemoteTip = new Views.NameHighlightedTextBlock("DeleteBranch.WithTrackingRemote", TrackingRemoteBranch.FriendlyName);
DeleteTrackingRemoteTip = new Views.NameHighlightedTextBlock("DeleteBranch.WithTrackingRemote", upstream);
} }
View = new Views.DeleteBranch() { DataContext = this }; View = new Views.DeleteBranch() { DataContext = this };

View file

@ -37,7 +37,7 @@ namespace SourceGit.ViewModels
{ {
foreach (var target in Targets) foreach (var target in Targets)
{ {
SetProgressDescription($"Deleting remote branch : {target.Remote}/{target.Name}"); SetProgressDescription($"Deleting remote branch : {target.FriendlyName}");
Commands.Branch.DeleteRemote(_repo.FullPath, target.Remote, target.Name); Commands.Branch.DeleteRemote(_repo.FullPath, target.Remote, target.Name);
} }
} }

View file

@ -39,8 +39,7 @@ namespace SourceGit.ViewModels
var check = $"{starter._prefix}{name}"; var check = $"{starter._prefix}{name}";
foreach (var b in starter._repo.Branches) foreach (var b in starter._repo.Branches)
{ {
var test = b.IsLocal ? b.Name : $"{b.Remote}/{b.Name}"; if (b.FriendlyName == check)
if (test == check)
return new ValidationResult("A branch with same name already exists!"); return new ValidationResult("A branch with same name already exists!");
} }
} }

View file

@ -175,7 +175,7 @@ namespace SourceGit.ViewModels
} }
else if (d.Type == Models.DecoratorType.RemoteBranchHead) else if (d.Type == Models.DecoratorType.RemoteBranchHead)
{ {
var b = _repo.Branches.Find(x => !x.IsLocal && d.Name == $"{x.Remote}/{x.Name}"); var b = _repo.Branches.Find(x => !x.IsLocal && d.Name == x.FriendlyName);
FillRemoteBranchMenu(menu, b, current, commit.IsMerged); FillRemoteBranchMenu(menu, b, current, commit.IsMerged);
} }
else if (d.Type == Models.DecoratorType.Tag) else if (d.Type == Models.DecoratorType.Tag)
@ -583,7 +583,7 @@ namespace SourceGit.ViewModels
private void FillRemoteBranchMenu(ContextMenu menu, Models.Branch branch, Models.Branch current, bool merged) private void FillRemoteBranchMenu(ContextMenu menu, Models.Branch branch, Models.Branch current, bool merged)
{ {
var name = $"{branch.Remote}/{branch.Name}"; var name = branch.FriendlyName;
var submenu = new MenuItem(); var submenu = new MenuItem();
submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Icon = App.CreateMenuIcon("Icons.Branch");

View file

@ -1202,7 +1202,7 @@ namespace SourceGit.ViewModels
if (upstream != null) if (upstream != null)
{ {
var fastForward = new MenuItem(); var fastForward = new MenuItem();
fastForward.Header = new Views.NameHighlightedTextBlock("BranchCM.FastForward", $"{upstream.Remote}/{upstream.Name}"); fastForward.Header = new Views.NameHighlightedTextBlock("BranchCM.FastForward", upstream.FriendlyName);
fastForward.Icon = App.CreateMenuIcon("Icons.FastForward"); fastForward.Icon = App.CreateMenuIcon("Icons.FastForward");
fastForward.IsEnabled = !string.IsNullOrEmpty(branch.UpstreamTrackStatus) && branch.UpstreamTrackStatus.IndexOf('↑') < 0; fastForward.IsEnabled = !string.IsNullOrEmpty(branch.UpstreamTrackStatus) && branch.UpstreamTrackStatus.IndexOf('↑') < 0;
fastForward.Click += (o, e) => fastForward.Click += (o, e) =>
@ -1491,9 +1491,10 @@ namespace SourceGit.ViewModels
{ {
var menu = new ContextMenu(); var menu = new ContextMenu();
var current = Branches.Find(x => x.IsCurrent); var current = Branches.Find(x => x.IsCurrent);
var name = branch.FriendlyName;
var checkout = new MenuItem(); var checkout = new MenuItem();
checkout.Header = new Views.NameHighlightedTextBlock("BranchCM.Checkout", $"{branch.Remote}/{branch.Name}"); checkout.Header = new Views.NameHighlightedTextBlock("BranchCM.Checkout", name);
checkout.Icon = App.CreateMenuIcon("Icons.Check"); checkout.Icon = App.CreateMenuIcon("Icons.Check");
checkout.Click += (o, e) => checkout.Click += (o, e) =>
{ {
@ -1506,7 +1507,7 @@ namespace SourceGit.ViewModels
if (current != null) if (current != null)
{ {
var pull = new MenuItem(); var pull = new MenuItem();
pull.Header = new Views.NameHighlightedTextBlock("BranchCM.PullInto", $"{branch.Remote}/{branch.Name}", current.Name); pull.Header = new Views.NameHighlightedTextBlock("BranchCM.PullInto", name, current.Name);
pull.Icon = App.CreateMenuIcon("Icons.Pull"); pull.Icon = App.CreateMenuIcon("Icons.Pull");
pull.Click += (o, e) => pull.Click += (o, e) =>
{ {
@ -1516,17 +1517,17 @@ namespace SourceGit.ViewModels
}; };
var merge = new MenuItem(); var merge = new MenuItem();
merge.Header = new Views.NameHighlightedTextBlock("BranchCM.Merge", $"{branch.Remote}/{branch.Name}", current.Name); merge.Header = new Views.NameHighlightedTextBlock("BranchCM.Merge", name, current.Name);
merge.Icon = App.CreateMenuIcon("Icons.Merge"); merge.Icon = App.CreateMenuIcon("Icons.Merge");
merge.Click += (o, e) => merge.Click += (o, e) =>
{ {
if (PopupHost.CanCreatePopup()) if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new Merge(this, $"{branch.Remote}/{branch.Name}", current.Name)); PopupHost.ShowPopup(new Merge(this, name, current.Name));
e.Handled = true; e.Handled = true;
}; };
var rebase = new MenuItem(); var rebase = new MenuItem();
rebase.Header = new Views.NameHighlightedTextBlock("BranchCM.Rebase", current.Name, $"{branch.Remote}/{branch.Name}"); rebase.Header = new Views.NameHighlightedTextBlock("BranchCM.Rebase", current.Name, name);
rebase.Icon = App.CreateMenuIcon("Icons.Rebase"); rebase.Icon = App.CreateMenuIcon("Icons.Rebase");
rebase.Click += (o, e) => rebase.Click += (o, e) =>
{ {
@ -1573,7 +1574,7 @@ namespace SourceGit.ViewModels
menu.Items.Add(new MenuItem() { Header = "-" }); menu.Items.Add(new MenuItem() { Header = "-" });
var delete = new MenuItem(); var delete = new MenuItem();
delete.Header = new Views.NameHighlightedTextBlock("BranchCM.Delete", $"{branch.Remote}/{branch.Name}"); delete.Header = new Views.NameHighlightedTextBlock("BranchCM.Delete", name);
delete.Icon = App.CreateMenuIcon("Icons.Clear"); delete.Icon = App.CreateMenuIcon("Icons.Clear");
delete.Click += (o, e) => delete.Click += (o, e) =>
{ {
@ -1617,7 +1618,7 @@ namespace SourceGit.ViewModels
copy.Icon = App.CreateMenuIcon("Icons.Copy"); copy.Icon = App.CreateMenuIcon("Icons.Copy");
copy.Click += (o, e) => copy.Click += (o, e) =>
{ {
App.CopyText(branch.Remote + "/" + branch.Name); App.CopyText(name);
e.Handled = true; e.Handled = true;
}; };
@ -1810,7 +1811,7 @@ namespace SourceGit.ViewModels
{ {
var dup = b; var dup = b;
var target = new MenuItem(); var target = new MenuItem();
target.Header = b.IsLocal ? b.Name : $"{b.Remote}/{b.Name}"; target.Header = b.FriendlyName;
target.Icon = App.CreateMenuIcon(b.IsCurrent ? "Icons.Check" : "Icons.Branch"); target.Icon = App.CreateMenuIcon(b.IsCurrent ? "Icons.Check" : "Icons.Branch");
target.Click += (_, e) => target.Click += (_, e) =>
{ {

View file

@ -23,7 +23,7 @@
<DataTemplate DataType="m:Branch"> <DataTemplate DataType="m:Branch">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/> <Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/>
<TextBlock VerticalAlignment="Center" Text="{Binding Converter={x:Static c:BranchConverters.ToName}}" Margin="8,0,0,0"/> <TextBlock VerticalAlignment="Center" Text="{Binding FriendlyName}" Margin="8,0,0,0"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>

View file

@ -61,7 +61,7 @@
User="{Binding BaseHead.Author}"/> User="{Binding BaseHead.Author}"/>
<TextBlock Grid.Column="1" Classes="monospace" Text="{Binding BaseHead.Author.Name}" Margin="8,0,0,0"/> <TextBlock Grid.Column="1" Classes="monospace" Text="{Binding BaseHead.Author.Name}" Margin="8,0,0,0"/>
<Border Grid.Column="2" Background="{DynamicResource Brush.Accent}" CornerRadius="4"> <Border Grid.Column="2" Background="{DynamicResource Brush.Accent}" CornerRadius="4">
<TextBlock Text="{Binding Base, Converter={x:Static c:BranchConverters.ToName}}" Classes="monospace" Margin="4,0" Foreground="#FFDDDDDD"/> <TextBlock Text="{Binding Base.FriendlyName}" Classes="monospace" Margin="4,0" Foreground="#FFDDDDDD"/>
</Border> </Border>
<TextBlock Grid.Column="3" Classes="monospace" Text="{Binding BaseHead.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" PointerPressed="OnPressedSHA"/> <TextBlock Grid.Column="3" Classes="monospace" Text="{Binding BaseHead.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" PointerPressed="OnPressedSHA"/>
<TextBlock Grid.Column="4" Classes="monospace" Text="{Binding BaseHead.CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/> <TextBlock Grid.Column="4" Classes="monospace" Text="{Binding BaseHead.CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
@ -82,7 +82,7 @@
User="{Binding ToHead.Author}"/> User="{Binding ToHead.Author}"/>
<TextBlock Grid.Column="1" Classes="monospace" Text="{Binding ToHead.Author.Name}" Margin="8,0,0,0"/> <TextBlock Grid.Column="1" Classes="monospace" Text="{Binding ToHead.Author.Name}" Margin="8,0,0,0"/>
<Border Grid.Column="2" Background="{DynamicResource Brush.Accent}" CornerRadius="4"> <Border Grid.Column="2" Background="{DynamicResource Brush.Accent}" CornerRadius="4">
<TextBlock Text="{Binding To, Converter={x:Static c:BranchConverters.ToName}}" Classes="monospace" Margin="4,0" Foreground="#FFDDDDDD"/> <TextBlock Text="{Binding To.FriendlyName}" Classes="monospace" Margin="4,0" Foreground="#FFDDDDDD"/>
</Border> </Border>
<TextBlock Grid.Column="3" Classes="monospace" Text="{Binding ToHead.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" PointerPressed="OnPressedSHA"/> <TextBlock Grid.Column="3" Classes="monospace" Text="{Binding ToHead.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" PointerPressed="OnPressedSHA"/>
<TextBlock Grid.Column="4" Classes="monospace" Text="{Binding ToHead.CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/> <TextBlock Grid.Column="4" Classes="monospace" Text="{Binding ToHead.CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>

View file

@ -24,7 +24,7 @@
<DataTemplate DataType="m:Branch"> <DataTemplate DataType="m:Branch">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/> <Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/>
<TextBlock VerticalAlignment="Center" Text="{Binding Converter={x:Static c:BranchConverters.ToName}}" Margin="8,0,0,0"/> <TextBlock VerticalAlignment="Center" Text="{Binding FriendlyName}" Margin="8,0,0,0"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>

View file

@ -23,7 +23,7 @@
<DataTemplate DataType="m:Branch"> <DataTemplate DataType="m:Branch">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/> <Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/>
<TextBlock VerticalAlignment="Center" Text="{Binding Converter={x:Static c:BranchConverters.ToName}}" Margin="8,0,0,0"/> <TextBlock VerticalAlignment="Center" Text="{Binding FriendlyName}" Margin="8,0,0,0"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>

View file

@ -18,7 +18,7 @@
<TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" Text="{DynamicResource Text.DeleteBranch.Branch}"/> <TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" Text="{DynamicResource Text.DeleteBranch.Branch}"/>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal"> <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
<Path Width="14" Height="14" Margin="8,0" Data="{StaticResource Icons.Branch}"/> <Path Width="14" Height="14" Margin="8,0" Data="{StaticResource Icons.Branch}"/>
<TextBlock Text="{Binding Target, Converter={x:Static c:BranchConverters.ToName}}"/> <TextBlock Text="{Binding Target.FriendlyName}}"/>
</StackPanel> </StackPanel>
<Border Grid.Row="1" Grid.Column="1" Height="32" IsVisible="{Binding !Target.IsLocal}"> <Border Grid.Row="1" Grid.Column="1" Height="32" IsVisible="{Binding !Target.IsLocal}">

View file

@ -64,8 +64,7 @@
<DataGridTemplateColumn Width="*" Header="NAME"> <DataGridTemplateColumn Width="*" Header="NAME">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={x:Static c:BranchConverters.ToName}}" ClipToBounds="True" <TextBlock Text="{Binding FriendlyName}" ClipToBounds="True" Classes="monospace" />
Classes="monospace" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>

View file

@ -16,7 +16,7 @@
<TextBlock Text="{Binding Local.Name}" Margin="8,0,0,0"/> <TextBlock Text="{Binding Local.Name}" Margin="8,0,0,0"/>
<TextBlock Text="→" Margin="8,0"/> <TextBlock Text="→" Margin="8,0"/>
<Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/> <Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/>
<TextBlock Text="{Binding To, Converter={x:Static c:BranchConverters.ToName}}" Margin="8,0,0,0"/> <TextBlock Text="{Binding To.FriendlyName}" Margin="8,0,0,0"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View file

@ -54,7 +54,7 @@
<Grid Grid.Row="1" ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,*" Margin="8"> <Grid Grid.Row="1" ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,*" Margin="8">
<TextBlock Grid.Column="0" Text="{DynamicResource Text.InteractiveRebase.Target}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/> <TextBlock Grid.Column="0" Text="{DynamicResource Text.InteractiveRebase.Target}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
<Path Grid.Column="1" Width="14" Height="14" Margin="8,0,0,0" Data="{StaticResource Icons.Branch}"/> <Path Grid.Column="1" Width="14" Height="14" Margin="8,0,0,0" Data="{StaticResource Icons.Branch}"/>
<TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding Current, Converter={x:Static c:BranchConverters.ToName}}" Margin="8,0,0,0"/> <TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding Current.FriendlyName}" Margin="8,0,0,0"/>
<TextBlock Grid.Column="3" Margin="48,0,0,0" Text="{DynamicResource Text.InteractiveRebase.On}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/> <TextBlock Grid.Column="3" Margin="48,0,0,0" Text="{DynamicResource Text.InteractiveRebase.On}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
<Path Grid.Column="4" Width="14" Height="14" Margin="8,8,0,0" Data="{StaticResource Icons.Commit}"/> <Path Grid.Column="4" Width="14" Height="14" Margin="8,8,0,0" Data="{StaticResource Icons.Commit}"/>

View file

@ -48,7 +48,7 @@
<DataTemplate x:DataType="{x:Type m:Branch}"> <DataTemplate x:DataType="{x:Type m:Branch}">
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
<Path Margin="0,0,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Branch}"/> <Path Margin="0,0,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Branch}"/>
<TextBlock Text="{Binding Converter={x:Static c:BranchConverters.ToName}}"/> <TextBlock Text="{Binding FriendlyName}"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>

View file

@ -31,7 +31,7 @@
<DataTemplate DataType="m:Branch"> <DataTemplate DataType="m:Branch">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/> <Path Width="14" Height="14" Data="{StaticResource Icons.Branch}"/>
<TextBlock VerticalAlignment="Center" Text="{Binding Converter={x:Static c:BranchConverters.ToName}}" Margin="8,0,0,0"/> <TextBlock VerticalAlignment="Center" Text="{Binding FriendlyName}" Margin="8,0,0,0"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>

View file

@ -269,7 +269,7 @@
</TreeView.Styles> </TreeView.Styles>
<TreeView.ItemTemplate> <TreeView.ItemTemplate>
<TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type vm:BranchTreeNode}"> <TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type vm:BranchTreeNode}">
<Grid Height="24" ColumnDefinitions="20,*,Auto,Auto" Background="Transparent" DoubleTapped="OnDoubleTappedBranchNode"> <Grid Height="24" ColumnDefinitions="20,*,Auto,Auto" Background="Transparent" DoubleTapped="OnDoubleTappedBranchNode" ToolTip.Tip="{Binding Tooltip}">
<Path Grid.Column="0" Classes="folder_icon" Width="12" Height="12" HorizontalAlignment="Left" Margin="0,1,0,0" IsVisible="{Binding IsFolder}"/> <Path Grid.Column="0" Classes="folder_icon" Width="12" Height="12" HorizontalAlignment="Left" Margin="0,1,0,0" IsVisible="{Binding IsFolder}"/>
<Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="0,2,0,0" Data="{StaticResource Icons.Check}" IsVisible="{Binding IsCurrent}" VerticalAlignment="Center"/> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="0,2,0,0" Data="{StaticResource Icons.Check}" IsVisible="{Binding IsCurrent}" VerticalAlignment="Center"/>
<Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="2,0,0,0" Data="{StaticResource Icons.Branch}" VerticalAlignment="Center"> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="2,0,0,0" Data="{StaticResource Icons.Branch}" VerticalAlignment="Center">
@ -281,7 +281,10 @@
</Path.IsVisible> </Path.IsVisible>
</Path> </Path>
<TextBlock Grid.Column="1" Text="{Binding Name}" Classes="monospace" FontWeight="{Binding IsCurrent, Converter={x:Static c:BoolConverters.BoldIfTrue}}"/> <TextBlock Grid.Column="1"
Text="{Binding Name}"
Classes="monospace"
FontWeight="{Binding IsCurrent, Converter={x:Static c:BoolConverters.BoldIfTrue}}"/>
<Border Grid.Column="2" Margin="8,0" Height="18" CornerRadius="9" VerticalAlignment="Center" Background="{DynamicResource Brush.Badge}" IsVisible="{Binding IsUpstreamTrackStatusVisible}"> <Border Grid.Column="2" Margin="8,0" Height="18" CornerRadius="9" VerticalAlignment="Center" Background="{DynamicResource Brush.Badge}" IsVisible="{Binding IsUpstreamTrackStatusVisible}">
<TextBlock Classes="monospace" FontSize="10" HorizontalAlignment="Center" Margin="9,0" Text="{Binding UpstreamTrackStatus}" Foreground="{DynamicResource Brush.BadgeFG}"/> <TextBlock Classes="monospace" FontSize="10" HorizontalAlignment="Center" Margin="9,0" Text="{Binding UpstreamTrackStatus}" Foreground="{DynamicResource Brush.BadgeFG}"/>
@ -294,7 +297,8 @@
IsVisible="{Binding IsBranch}" IsVisible="{Binding IsBranch}"
Checked="OnToggleFilter" Checked="OnToggleFilter"
Unchecked="OnToggleFilter" Unchecked="OnToggleFilter"
IsChecked="{Binding IsFiltered}"/> IsChecked="{Binding IsFiltered}"
ToolTip.Tip="{DynamicResource Text.Filter}"/>
</Grid> </Grid>
</TreeDataTemplate> </TreeDataTemplate>
</TreeView.ItemTemplate> </TreeView.ItemTemplate>
@ -343,7 +347,7 @@
<TreeView.ItemTemplate> <TreeView.ItemTemplate>
<TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type vm:BranchTreeNode}"> <TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type vm:BranchTreeNode}">
<Grid Height="24" ColumnDefinitions="20,*,Auto" Background="Transparent" DoubleTapped="OnDoubleTappedBranchNode"> <Grid Height="24" ColumnDefinitions="20,*,Auto" Background="Transparent" DoubleTapped="OnDoubleTappedBranchNode" ToolTip.Tip="{Binding Tooltip}">
<Path Grid.Column="0" Classes="folder_icon" Width="10" Height="10" HorizontalAlignment="Left" Margin="0,2,0,0" IsVisible="{Binding IsFolder}" VerticalAlignment="Center"/> <Path Grid.Column="0" Classes="folder_icon" Width="10" Height="10" HorizontalAlignment="Left" Margin="0,2,0,0" IsVisible="{Binding IsFolder}" VerticalAlignment="Center"/>
<Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="0,2,0,0" Data="{StaticResource Icons.Remote}" IsVisible="{Binding IsRemote}" VerticalAlignment="Center"/> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="0,2,0,0" Data="{StaticResource Icons.Remote}" IsVisible="{Binding IsRemote}" VerticalAlignment="Center"/>
<Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="2,0,0,0" Data="{StaticResource Icons.Branch}" IsVisible="{Binding IsBranch}" VerticalAlignment="Center"/> <Path Grid.Column="0" Width="12" Height="12" HorizontalAlignment="Left" Margin="2,0,0,0" Data="{StaticResource Icons.Branch}" IsVisible="{Binding IsBranch}" VerticalAlignment="Center"/>
@ -357,7 +361,8 @@
Checked="OnToggleFilter" Checked="OnToggleFilter"
Unchecked="OnToggleFilter" Unchecked="OnToggleFilter"
IsVisible="{Binding IsBranch}" IsVisible="{Binding IsBranch}"
IsChecked="{Binding IsFiltered}"/> IsChecked="{Binding IsFiltered}"
ToolTip.Tip="{DynamicResource Text.Filter}"/>
</Grid> </Grid>
</TreeDataTemplate> </TreeDataTemplate>
</TreeView.ItemTemplate> </TreeView.ItemTemplate>
@ -444,7 +449,8 @@
Background="Transparent" Background="Transparent"
Checked="OnToggleFilter" Checked="OnToggleFilter"
Unchecked="OnToggleFilter" Unchecked="OnToggleFilter"
IsChecked="{Binding IsFiltered}"/> IsChecked="{Binding IsFiltered}"
ToolTip.Tip="{DynamicResource Text.Filter}"/>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>