Skip to content

Commit 54c9552

Browse files
committed
refactor: remove duplicate ObjectConverters, remove unused using
1 parent f4e1e0f commit 54c9552

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

src/Converters/ObjectConverters.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/ViewModels/DiffContext.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using Avalonia.Threading;
99

1010
using CommunityToolkit.Mvvm.ComponentModel;
11-
using SourceGit.Models;
1211

1312
namespace SourceGit.ViewModels
1413
{
@@ -74,10 +73,7 @@ public Models.FileModeDiff FileModeDiff
7473
set => SetProperty(ref _fileModeDiff, value);
7574
}
7675

77-
public TextTrimming PathTrimming
78-
{
79-
get => _pathTrimming;
80-
}
76+
public TextTrimming PathTrimming { get; } = new TextLeadingPrefixTrimming("...", 20);
8177

8278
public DiffContext(string repo, Models.DiffOption option, DiffContext previous = null)
8379
{
@@ -199,6 +195,5 @@ private Bitmap BitmapFromRevisionFile(string repo, string revision, string file)
199195
private object _content = null;
200196
private Vector _syncScrollOffset = Vector.Zero;
201197
private Models.FileModeDiff _fileModeDiff = null;
202-
private TextTrimming _pathTrimming = new TextLeadingPrefixTrimming("...", 20);
203198
}
204199
}

src/Views/DiffView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<Path DockPanel.Dock="Right" Classes="rotating" Width="10" Height="10" Margin="8,0" Data="{StaticResource Icons.Loading}" IsVisible="{Binding IsLoading}"/>
2828
</DockPanel>
2929

30-
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" IsVisible="{Binding FileModeDiff, Converter={x:Static c:ObjectConverters.IsNotNull}}">
30+
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" IsVisible="{Binding FileModeDiff, Converter={x:Static ObjectConverters.IsNotNull}}">
3131
<TextBlock Classes="monospace" Margin="8,0,0,0" Text="{DynamicResource Text.Diff.FileModeChanged}" FontSize="11"/>
3232
<TextBlock Classes="monospace" Text="{Binding FileModeDiff.Old}" FontSize="11"/>
3333
<TextBlock Margin="4,0" Text=""/>

0 commit comments

Comments
 (0)