From 24ca3eaf8c7f08d6ce90d97387a91e2b481495cf Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 14 Jul 2024 16:06:40 +0800 Subject: [PATCH] ux: tree folder icon margin --- src/Views/BranchTree.axaml | 2 +- src/Views/RevisionFileTreeView.axaml.cs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Views/BranchTree.axaml b/src/Views/BranchTree.axaml index 695f8d3b..a2a34065 100644 --- a/src/Views/BranchTree.axaml +++ b/src/Views/BranchTree.axaml @@ -67,7 +67,7 @@ diff --git a/src/Views/RevisionFileTreeView.axaml.cs b/src/Views/RevisionFileTreeView.axaml.cs index 2ff528c8..ffed4a92 100644 --- a/src/Views/RevisionFileTreeView.axaml.cs +++ b/src/Views/RevisionFileTreeView.axaml.cs @@ -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,