ux: tree folder icon margin

This commit is contained in:
leo 2024-07-14 16:06:40 +08:00
parent a807aa9e12
commit 24ca3eaf8c
No known key found for this signature in database
2 changed files with 6 additions and 5 deletions

View file

@ -67,7 +67,7 @@
<!-- Content Area (allows double-click) -->
<Grid Grid.Column="1"
Background="Transparent"
ColumnDefinitions="20,*,Auto,Auto"
ColumnDefinitions="18,*,Auto,Auto"
DoubleTapped="OnDoubleTappedBranchNode">
<!-- Icon -->

View file

@ -68,18 +68,18 @@ namespace SourceGit.Views
switch (obj.Type)
{
case Models.ObjectType.Blob:
CreateContent("Icons.File");
CreateContent("Icons.File", new Thickness(0, 0, 0, 0));
break;
case Models.ObjectType.Commit:
CreateContent("Icons.Submodule");
CreateContent("Icons.Submodule", new Thickness(0, 0, 0, 0));
break;
default:
CreateContent(node.IsExpanded ? "Icons.Folder.Open" : "Icons.Folder.Fill", Brushes.Goldenrod);
CreateContent(node.IsExpanded ? "Icons.Folder.Open" : "Icons.Folder.Fill", new Thickness(0, 2, 0, 0), Brushes.Goldenrod);
break;
}
}
private void CreateContent(string iconKey, IBrush fill = null)
private void CreateContent(string iconKey, Thickness margin, IBrush fill = null)
{
var geo = this.FindResource(iconKey) as StreamGeometry;
if (geo == null)
@ -89,6 +89,7 @@ namespace SourceGit.Views
{
Width = 14,
Height = 14,
Margin = margin,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Center,
Data = geo,