feat: using Padding instead of Gap in Avatar.

This commit is contained in:
Zhang Dian
2025-01-17 16:05:52 +08:00
parent 33bfd67833
commit a366ca6f0c
4 changed files with 8 additions and 43 deletions

View File

@@ -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
{

View File

@@ -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();
}
}