Skip to content

[Windows] Clamp images inside buttons to button width/height#22276

Merged
Foda merged 14 commits into
mainfrom
foda/imgbuttonresizemain
May 15, 2024
Merged

[Windows] Clamp images inside buttons to button width/height#22276
Foda merged 14 commits into
mainfrom
foda/imgbuttonresizemain

Conversation

@Foda
Copy link
Copy Markdown
Contributor

@Foda Foda commented May 7, 2024

Description of Change

This PR forces images inside buttons to always fit inside the available space, rather than expand be clipped

Issues Fixed

Fixes #21683 #21970

@Foda Foda requested review from PureWeen and mattleibow May 7, 2024 17:15
@Foda Foda requested a review from a team as a code owner May 7, 2024 17:15
@dotnet-policy-service dotnet-policy-service Bot added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 7, 2024
Copy link
Copy Markdown
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Have done tests with some samples like Issue18242.
image
The behavior looks good so far, but, in the snapshot from Issue21513Test, the first image seems to be clipped:
image

Is this expected?

@mattleibow
Copy link
Copy Markdown
Member

As @jsuarezruiz noticed, the image is clipped. But if you look at all the other images, they are all clipping now. Or rather, still clipping. Should they?

@jsuarezruiz
Copy link
Copy Markdown
Contributor

jsuarezruiz commented May 10, 2024

After the latest changes related with spacing, the snapshot for the test Issue21513Test needs changes.

Snapshot different than baseline: Issue21513Test.png (0.62% difference)

image

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Copy link
Copy Markdown
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

Looks good!

Not sure if there is value in a device test for Windows that picks a few sizes/options and then renders it on screen. The test would be to make sure the position of things are where they are expected to be.

@Foda Foda merged commit 374e9dd into main May 15, 2024
@Foda Foda deleted the foda/imgbuttonresizemain branch May 15, 2024 18:07
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] Image on button not scaling down for all scenarios when dimensions are less than button

6 participants