forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Windows] Fix image button scaling (dotnet#20949)
* Cherry pick Windows only changes for fix-18242 * Revert change to csproj --------- Co-authored-by: Mike Corsaro <[email protected]>
- Loading branch information
Showing
5 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/Controls/samples/Controls.Sample.UITests/Issues/Issue18242.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?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.Issue18242" | ||
Title="Issue 18242"> | ||
<VerticalStackLayout | ||
Padding="12"> | ||
<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 | ||
Text="Button with Height"/> | ||
<Button | ||
HeightRequest="50" | ||
ImageSource="dotnet_bot.png" | ||
ContentLayout="Left,10" | ||
Text="Button"/> | ||
<Label | ||
Text="Button without Height"/> | ||
<Button | ||
ImageSource="dotnet_bot.png" | ||
ContentLayout="Left,10" | ||
Text="Button"/> | ||
<Label | ||
Text="2. The image must adapt to the size of the ImageButton."/> | ||
<Label | ||
Text="ImageButton with Height"/> | ||
<ImageButton | ||
HeightRequest="30" | ||
WidthRequest="50" | ||
Source="dotnet_bot.png"/> | ||
<Label | ||
Text="ImageButton without Height"/> | ||
<ImageButton | ||
WidthRequest="50" | ||
Source="dotnet_bot.png"/> | ||
</VerticalStackLayout> | ||
</ContentPage> |
15 changes: 15 additions & 0 deletions
15
src/Controls/samples/Controls.Sample.UITests/Issues/Issue18242.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, 18242, "Button ImageSource not Scaling as expected", PlatformAffected.UWP)] | ||
public partial class Issue18242 : ContentPage | ||
{ | ||
public Issue18242() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Issue18242 : _IssuesUITest | ||
{ | ||
public Issue18242(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
public override string Issue => "Button ImageSource not Scaling as expected"; | ||
|
||
[Test] | ||
public void Issue18242Test() | ||
{ | ||
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters