Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[housekeeping] Automated PR to fix formatting errors #13306

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Layouts;
using Xunit;
using NSubstitute;
using Xunit;

namespace Microsoft.Maui.Controls.Core.UnitTests.Layouts
{
Expand Down Expand Up @@ -91,7 +91,7 @@ public void FlexLayoutRecognizesVisibilityChange()
* depending on the target platform.
*/

(IFlexLayout, IView) SetUpUnconstrainedTest()
(IFlexLayout, IView) SetUpUnconstrainedTest()
{
var root = new Grid(); // FlexLayout requires a parent, at least for now
var flexLayout = new FlexLayout() as IFlexLayout;
Expand All @@ -114,7 +114,7 @@ public void UnconstrainedHeightChildrenHaveHeight()
_ = flexLayout.CrossPlatformMeasure(400, double.PositiveInfinity);

var flexFrame = flexLayout.GetFlexFrame(view);

Assert.Equal(100, flexFrame.Height);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void CreateLayout(Type layoutType, out Layout layout, out Label label)
}

[Fact, Category(TestCategory.FlexLayout)]
public async Task FlexLayoutInVerticalStackLayoutDoesNotCycle()
public async Task FlexLayoutInVerticalStackLayoutDoesNotCycle()
{
await FlexLayoutInStackLayoutDoesNotCycle(new VerticalStackLayout());
}
Expand All @@ -182,7 +182,7 @@ await InvokeOnMainThreadAsync(async () =>

// If this can be attached to the hierarchy and make it through a layout
// without crashing, then we're good.

await root.ToPlatform(MauiContext).AttachAndRun(() => { });
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Layouts/Flex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ static void layout_item(Item item, float width, float height)
layout.flex_grows += child.Grow;
layout.flex_shrinks += child.Shrink;

if(layout.flex_dim > 0)
if (layout.flex_dim > 0)
{
// If flex_dim is zero, it's because we're measuring unconstrained in that direction
// So we don't need to keep a running tally of available space
Expand Down
4 changes: 2 additions & 2 deletions src/Core/src/Platform/Windows/SliderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ void OnImageOpened(object sender, RoutedEventArgs e)
thumb.Height = bitmapImage.PixelHeight;
thumb.Width = bitmapImage.PixelWidth;
}

if (nativeSlider.Parent is FrameworkElement frameworkElement)
frameworkElement.InvalidateMeasure();
};
}

nativeSlider.ThumbImageSource = nativeThumbImageSource?.Value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ await InvokeOnMainThreadAsync(async () =>
bool imageLoaded = await Wait(() => ImageSourceLoaded(handler));

Assert.True(imageLoaded);

await Task.Delay(100);

var expectedColor = Color.FromArgb("#FF0000");
Expand All @@ -84,7 +84,7 @@ await InvokeOnMainThreadAsync(async () =>

bool imageLoaded = await Wait(() => ImageSourceLoaded(handler));
Assert.True(imageLoaded);

await handler.PlatformView.AttachAndRun(async () =>
{
// Update the Slider ThumbImageSource
Expand Down Expand Up @@ -117,8 +117,8 @@ double GetSmallChange(SliderHandler sliderHandler) =>
Size GetNativeThumbSize(SliderHandler sliderHandler)
{
var nativeSlider = GetNativeSlider(sliderHandler);
if(nativeSlider.GetFirstDescendant<Thumb>() is Thumb thumb)

if (nativeSlider.GetFirstDescendant<Thumb>() is Thumb thumb)
{
return new Size(thumb.Width, thumb.Height);
}
Expand All @@ -128,7 +128,7 @@ Size GetNativeThumbSize(SliderHandler sliderHandler)

bool ImageSourceLoaded(SliderHandler sliderHandler)
{
return (sliderHandler.PlatformView as MauiSlider)?.ThumbImageSource != null;
return (sliderHandler.PlatformView as MauiSlider)?.ThumbImageSource != null;
}
}
}