mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-23 01:36:57 -08:00
refactor: remove duplicate ObjectConverters, remove unused using
This commit is contained in:
parent
f4e1e0fb6b
commit
54c9552985
3 changed files with 2 additions and 20 deletions
|
@ -1,13 +0,0 @@
|
|||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace SourceGit.Converters
|
||||
{
|
||||
public static class ObjectConverters
|
||||
{
|
||||
public static readonly FuncValueConverter<object, bool> IsNull =
|
||||
new FuncValueConverter<object, bool>(v => v == null);
|
||||
|
||||
public static readonly FuncValueConverter<object, bool> IsNotNull =
|
||||
new FuncValueConverter<object, bool>(v => v != null);
|
||||
}
|
||||
}
|
|
@ -8,7 +8,6 @@ using Avalonia.Media.Imaging;
|
|||
using Avalonia.Threading;
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using SourceGit.Models;
|
||||
|
||||
namespace SourceGit.ViewModels
|
||||
{
|
||||
|
@ -74,10 +73,7 @@ namespace SourceGit.ViewModels
|
|||
set => SetProperty(ref _fileModeDiff, value);
|
||||
}
|
||||
|
||||
public TextTrimming PathTrimming
|
||||
{
|
||||
get => _pathTrimming;
|
||||
}
|
||||
public TextTrimming PathTrimming { get; } = new TextLeadingPrefixTrimming("...", 20);
|
||||
|
||||
public DiffContext(string repo, Models.DiffOption option, DiffContext previous = null)
|
||||
{
|
||||
|
@ -199,6 +195,5 @@ namespace SourceGit.ViewModels
|
|||
private object _content = null;
|
||||
private Vector _syncScrollOffset = Vector.Zero;
|
||||
private Models.FileModeDiff _fileModeDiff = null;
|
||||
private TextTrimming _pathTrimming = new TextLeadingPrefixTrimming("...", 20);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<Path DockPanel.Dock="Right" Classes="rotating" Width="10" Height="10" Margin="8,0" Data="{StaticResource Icons.Loading}" IsVisible="{Binding IsLoading}"/>
|
||||
</DockPanel>
|
||||
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" IsVisible="{Binding FileModeDiff, Converter={x:Static c:ObjectConverters.IsNotNull}}">
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" IsVisible="{Binding FileModeDiff, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<TextBlock Classes="monospace" Margin="8,0,0,0" Text="{DynamicResource Text.Diff.FileModeChanged}" FontSize="11"/>
|
||||
<TextBlock Classes="monospace" Text="{Binding FileModeDiff.Old}" FontSize="11"/>
|
||||
<TextBlock Margin="4,0" Text="→"/>
|
||||
|
|
Loading…
Reference in a new issue