mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08:00
fix: use TextTrimming alternative PathConverters
This commit is contained in:
parent
f7dd856e49
commit
f4e1e0fb6b
2 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
<DockPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
<Path DockPanel.Dock="Left" Width="12" Height="12" Data="{StaticResource Icons.File}" Margin="8,0,0,0"/>
|
||||
<TextBlock Classes="monospace" Margin="4,0,0,0" Text="{Binding FilePath, Converter={x:Static c:PathConverters.TruncateIfTooLong}}"
|
||||
TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Stretch" ToolTip.Tip="{Binding FilePath}" FontSize="11"/>
|
||||
<TextBlock Classes="monospace" Margin="4,0,0,0" Text="{Binding FilePath}"
|
||||
TextTrimming="{Binding PathTrimming}" TextWrapping="NoWrap" HorizontalAlignment="Stretch" ToolTip.Tip="{Binding FilePath}" FontSize="11"/>
|
||||
<Path DockPanel.Dock="Right" Classes="rotating" Width="10" Height="10" Margin="8,0" Data="{StaticResource Icons.Loading}" IsVisible="{Binding IsLoading}"/>
|
||||
</DockPanel>
|
||||
|
||||
|
|
Loading…
Reference in a new issue