feat: using Padding instead of Gap in Avatar.
This commit is contained in:
@@ -7,21 +7,12 @@ namespace Ursa.Controls;
|
||||
|
||||
public class Avatar : Button
|
||||
{
|
||||
public static readonly StyledProperty<double> GapProperty = AvaloniaProperty.Register<Avatar, double>(
|
||||
nameof(Gap));
|
||||
|
||||
public static readonly StyledProperty<IImage?> SourceProperty = AvaloniaProperty.Register<Avatar, IImage?>(
|
||||
nameof(Source));
|
||||
|
||||
public static readonly StyledProperty<object?> HoverMaskProperty = AvaloniaProperty.Register<Avatar, object?>(
|
||||
nameof(HoverMask));
|
||||
|
||||
public double Gap
|
||||
{
|
||||
get => GetValue(GapProperty);
|
||||
set => SetValue(GapProperty, value);
|
||||
}
|
||||
|
||||
[ExcludeFromCodeCoverage]
|
||||
public IImage? Source
|
||||
{
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace Ursa.Converters;
|
||||
|
||||
public class DoubleToThicknessConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is double d)
|
||||
{
|
||||
return new Thickness(d, 0);
|
||||
}
|
||||
|
||||
return AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
|
||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user