From f4e1e0fb6bf860324d0af334bcf4bca4fecbbde8 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Sat, 13 Apr 2024 02:05:26 +0800 Subject: [PATCH] fix: use TextTrimming alternative PathConverters --- src/ViewModels/DiffContext.cs | 7 +++++++ src/Views/DiffView.axaml | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/DiffContext.cs b/src/ViewModels/DiffContext.cs index 19449cc9..7c2aab14 100644 --- a/src/ViewModels/DiffContext.cs +++ b/src/ViewModels/DiffContext.cs @@ -3,6 +3,7 @@ using System.IO; using System.Threading.Tasks; using Avalonia; +using Avalonia.Media; using Avalonia.Media.Imaging; using Avalonia.Threading; @@ -73,6 +74,11 @@ namespace SourceGit.ViewModels set => SetProperty(ref _fileModeDiff, value); } + public TextTrimming PathTrimming + { + get => _pathTrimming; + } + public DiffContext(string repo, Models.DiffOption option, DiffContext previous = null) { _repo = repo; @@ -193,5 +199,6 @@ namespace SourceGit.ViewModels private object _content = null; private Vector _syncScrollOffset = Vector.Zero; private Models.FileModeDiff _fileModeDiff = null; + private TextTrimming _pathTrimming = new TextLeadingPrefixTrimming("...", 20); } } diff --git a/src/Views/DiffView.axaml b/src/Views/DiffView.axaml index 80e9f56c..cb56de34 100644 --- a/src/Views/DiffView.axaml +++ b/src/Views/DiffView.axaml @@ -22,8 +22,8 @@ - +