code_style: remove all IDE warnings

This commit is contained in:
leo 2024-07-14 15:55:15 +08:00
parent 9ac550242e
commit a807aa9e12
No known key found for this signature in database
94 changed files with 785 additions and 807 deletions

View file

@ -64,7 +64,7 @@ namespace SourceGit.Views
}
public static readonly StyledProperty<Bitmap> OldImageProperty =
AvaloniaProperty.Register<ImagesSwipeControl, Bitmap>(nameof(OldImage), null);
AvaloniaProperty.Register<ImagesSwipeControl, Bitmap>(nameof(OldImage));
public Bitmap OldImage
{
@ -73,7 +73,7 @@ namespace SourceGit.Views
}
public static readonly StyledProperty<Bitmap> NewImageProperty =
AvaloniaProperty.Register<ImagesSwipeControl, Bitmap>(nameof(NewImage), null);
AvaloniaProperty.Register<ImagesSwipeControl, Bitmap>(nameof(NewImage));
public Bitmap NewImage
{
@ -185,13 +185,9 @@ namespace SourceGit.Views
private Size GetDesiredSize(Size img, Size available)
{
var w = available.Width;
var h = available.Height;
var sw = available.Width / img.Width;
var sh = available.Height / img.Height;
var scale = Math.Min(sw, sh);
return new Size(scale * img.Width, scale * img.Height);
}
@ -211,7 +207,7 @@ namespace SourceGit.Views
}
public static readonly StyledProperty<Bitmap> OldImageProperty =
AvaloniaProperty.Register<ImageBlendControl, Bitmap>(nameof(OldImage), null);
AvaloniaProperty.Register<ImageBlendControl, Bitmap>(nameof(OldImage));
public Bitmap OldImage
{
@ -220,7 +216,7 @@ namespace SourceGit.Views
}
public static readonly StyledProperty<Bitmap> NewImageProperty =
AvaloniaProperty.Register<ImageBlendControl, Bitmap>(nameof(NewImage), null);
AvaloniaProperty.Register<ImageBlendControl, Bitmap>(nameof(NewImage));
public Bitmap NewImage
{
@ -294,13 +290,9 @@ namespace SourceGit.Views
private Size GetDesiredSize(Size img, Size available)
{
var w = available.Width;
var h = available.Height;
var sw = available.Width / img.Width;
var sh = available.Height / img.Height;
var scale = Math.Min(sw, sh);
return new Size(scale * img.Width, scale * img.Height);
}