Skip to content
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
Expand Up @@ -46,8 +46,8 @@
<MauiImage Include="Resources\Images\dotnet_bot.svg" Link="Resources\Images\small_dotnet_bot.svg" Color="#FFFFFF" BaseSize="64,64" />
<MauiImage Include="Resources\AppIcons\appicon.svg" ForegroundFile="Resources\AppIcons\appicon_foreground.svg" IsAppIcon="true" />
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#FFFFFF" BaseSize="168,208" />
<MauiFont Include="Resources\Fonts\OpenSans-Regular.ttf" />
</ItemGroup>

<Import Project="$(MauiSrcDirectory)Maui.InTree.props" Condition=" '$(UseMaui)' != 'true' " />

</Project>
33 changes: 17 additions & 16 deletions src/Controls/samples/Controls.Sample.UITests/Issues/Issue18242.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue18242"
Title="Issue 18242">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be a new page? I just finished up the Android fixes and if there are 2 columns this page will be too narrow and cramped for a good test on android/ios

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's probably a good idea.

<VerticalStackLayout
Padding="12">
<Label
<VerticalStackLayout
Padding="12"
Grid.Column="0">
<Label
AutomationId="WaitForStubControl"
Text="1. The image must adapt to the size of the Button and be in the position determined by the ContentLayout property."/>
<Label
<Label
Text="Button with Height"/>
<Button
<Button
HeightRequest="50"
ImageSource="dotnet_bot.png"
ContentLayout="Left,10"
Text="Button"/>
<Label
<Label
Text="Button without Height"/>
<Button
<Button
ImageSource="dotnet_bot.png"
ContentLayout="Left,10"
Text="Button"/>
<Label
<Label
Text="2. The image must adapt to the size of the ImageButton."/>
<Label
<Label
Text="ImageButton with Height"/>
<ImageButton
<ImageButton
HeightRequest="30"
WidthRequest="50"
Source="dotnet_bot.png"/>
<Label
Text="ImageButton without Height"/>
<ImageButton
WidthRequest="50"
Source="dotnet_bot.png"/>
</VerticalStackLayout>
<Label
Text="ImageButton without Height"/>
<ImageButton
WidthRequest="50"
Source="dotnet_bot.png"/>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue21202"
Title="Issue 21202">
<VerticalStackLayout
Padding="12"
Grid.Column="1">
<Label
AutomationId="WaitForStubControl"
Text="1. Font image source should not be stretched on button with height requested."/>
<Button
FontSize="18"
HeightRequest="60"
HorizontalOptions="Fill"
Text="Button with height request set"
TextTransform="Uppercase"
FontFamily="OpenSansRegular">
<Button.ImageSource>
<FontImageSource Glyph="A" Color="Black" FontFamily="OpenSansRegular"/>
</Button.ImageSource>
</Button>
<Label
Text="2. Font image source should not be stretched on button without height requested."/>
<Button
FontSize="18"
HorizontalOptions="Fill"
Text="Button without height request"
TextTransform="Uppercase"
FontFamily="OpenSansRegular">
<Button.ImageSource>
<FontImageSource Glyph="A" Color="Black" FontFamily="OpenSansRegular"/>
</Button.ImageSource>
</Button>
<Label
Text="3. Button without height request should resize to font image source size."/>
<Button
FontSize="18"
HorizontalOptions="Fill"
Text="Button without height request, resize to font image"
TextTransform="Uppercase"
FontFamily="OpenSansRegular">
<Button.ImageSource>
<FontImageSource Glyph="A" Size="60" Color="Black" FontFamily="OpenSansRegular"/>
</Button.ImageSource>
</Button>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;

namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 21202, "FontImageSource incorrectly sized", PlatformAffected.UWP)]
public partial class Issue21202 : ContentPage
{
public Issue21202()
{
InitializeComponent();
}
}
}
8 changes: 6 additions & 2 deletions src/Controls/samples/Controls.Sample.UITests/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ public static class MauiProgram
public static MauiApp CreateMauiApp() =>
MauiApp
.CreateBuilder()
#if IOS || ANDROID
#if IOS || ANDROID
.UseMauiMaps()
#endif
#endif
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
})
.Build();
}

Expand Down
Binary file not shown.
25 changes: 25 additions & 0 deletions src/Controls/tests/UITests/Tests/Issues/Issue21202.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.AppiumTests.Issues
{
public class Issue21202 : _IssuesUITest
{
public Issue21202(TestDevice device) : base(device)
{
}

public override string Issue => "FontImageSource incorrectly sized";

[Test]
public void Issue21202Test()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.iOS }, "Only Windows for now");

App.WaitForElement("WaitForStubControl");

VerifyScreenshot();
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.