mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-25 14:15:00 +00:00
ux: new style for current branch (#998)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
3d4a9b86b4
commit
5d2cd8b2fa
3 changed files with 18 additions and 19 deletions
|
@ -52,31 +52,31 @@ namespace SourceGit.Views
|
|||
|
||||
if (node.Backend is Models.Remote)
|
||||
{
|
||||
CreateContent(new Thickness(0, 0, 0, 0), "Icons.Remote");
|
||||
CreateContent(new Thickness(0, 0, 0, 0), "Icons.Remote", false);
|
||||
}
|
||||
else if (node.Backend is Models.Branch branch)
|
||||
{
|
||||
if (branch.IsCurrent)
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Check");
|
||||
CreateContent(new Thickness(0, 0, 0, 0), "Icons.CheckCircled", true);
|
||||
else
|
||||
CreateContent(new Thickness(2, 0, 0, 0), "Icons.Branch");
|
||||
CreateContent(new Thickness(2, 0, 0, 0), "Icons.Branch", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node.IsExpanded)
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder.Open");
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder.Open", false);
|
||||
else
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder");
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder", false);
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateContent(Thickness margin, string iconKey)
|
||||
private void CreateContent(Thickness margin, string iconKey, bool highlight)
|
||||
{
|
||||
var geo = this.FindResource(iconKey) as StreamGeometry;
|
||||
if (geo == null)
|
||||
return;
|
||||
|
||||
Content = new Path()
|
||||
var path = new Path()
|
||||
{
|
||||
Width = 12,
|
||||
Height = 12,
|
||||
|
@ -85,6 +85,11 @@ namespace SourceGit.Views
|
|||
Margin = margin,
|
||||
Data = geo,
|
||||
};
|
||||
|
||||
if (highlight)
|
||||
path.Fill = Brushes.Green;
|
||||
|
||||
Content = path;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue