-
Notifications
You must be signed in to change notification settings - Fork 1.9k
(Windows) ImageButton contents now explicitly stretches #17159
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
17cf9e3
ImageButton contents now explicitly stretches to prevent odd resizing…
403c910
Merge branch 'main' into foda/ImageButtonStretch
1df948e
Add stuff for image regression testing
f1b23d2
Merge branch 'main' into foda/ImageButtonStretch
jsuarezruiz fb7a81b
Add snapshot image and fix element names
5863d16
Merge branch 'foda/ImageButtonStretch' of https://github.com/dotnet/m…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
50 changes: 50 additions & 0 deletions
50
src/Controls/samples/Controls.Sample.UITests/Issues/Issue16918.xaml
This file contains hidden or 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,50 @@ | ||
<?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.Issue16918" | ||
xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues"> | ||
<ScrollView> | ||
<VerticalStackLayout | ||
Spacing="25" | ||
Padding="30,0" | ||
VerticalOptions="Center"> | ||
<Label | ||
Text="Image (SVG 40x40):" | ||
HorizontalOptions="Center" /> | ||
<Image | ||
Source="menu_entry_settings_40.png" | ||
SemanticProperties.Description="Cute dot net bot waving hi to you!" | ||
HeightRequest="40" | ||
HorizontalOptions="Center" /> | ||
|
||
<Label | ||
Text="ImageButton (SVG 40x40):" | ||
HorizontalOptions="Center" /> | ||
<ImageButton | ||
Source="menu_entry_settings_40.png" | ||
SemanticProperties.Description="Cute dot net bot waving hi to you!" | ||
HeightRequest="40" | ||
BackgroundColor="Transparent" | ||
HorizontalOptions="Center" /> | ||
|
||
<Label | ||
Text="Image (SVG 210x210):" | ||
HorizontalOptions="Center" /> | ||
<Image | ||
Source="menu_entry_settings_210.png" | ||
SemanticProperties.Description="Cute dot net bot waving hi to you!" | ||
HeightRequest="40" | ||
HorizontalOptions="Center" /> | ||
|
||
<Label | ||
Text="ImageButton (SVG 210x210):" | ||
HorizontalOptions="Center" /> | ||
<ImageButton | ||
Source="menu_entry_settings_210.png" | ||
SemanticProperties.Description="Cute dot net bot waving hi to you!" | ||
HeightRequest="40" | ||
BackgroundColor="Transparent" | ||
HorizontalOptions="Center" /> | ||
</VerticalStackLayout> | ||
</ScrollView> | ||
</ContentPage> |
15 changes: 15 additions & 0 deletions
15
src/Controls/samples/Controls.Sample.UITests/Issues/Issue16918.xaml.cs
This file contains hidden or 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, 16918, "ImageButton is not properly anti-aliased when scaled down", PlatformAffected.UWP)] | ||
public partial class Issue16918 : ContentPage | ||
{ | ||
public Issue16918() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...ls/samples/Controls.Sample.UITests/Resources/Images/menu_entry_settings_210.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions
48
...ols/samples/Controls.Sample.UITests/Resources/Images/menu_entry_settings_40.svg
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 hidden or 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,30 @@ | ||
using Microsoft.Maui.Appium; | ||
using Microsoft.Maui.AppiumTests; | ||
using NUnit.Framework; | ||
|
||
namespace Controls.AppiumTests.Tests.Issues | ||
{ | ||
public class Issue16918 : _IssuesUITest | ||
{ | ||
public Issue16918(TestDevice device) | ||
: base(device) | ||
{ } | ||
|
||
public override string Issue => "Image buttons aliasing"; | ||
|
||
[Test] | ||
public void Issue16918Test() | ||
{ | ||
// https://github.com/dotnet/maui/issues/16918 | ||
UITestContext.IgnoreIfPlatforms(new[] | ||
{ | ||
TestDevice.Mac, | ||
TestDevice.Android, | ||
TestDevice.iOS | ||
}); | ||
|
||
App.WaitForElement("WaitForStubControl"); | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.