Repository navigation
[iOS/MacCatalyst] Fix Entry clear button appearing dimmed compared to TextColor - #36472
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36472Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36472" |
|
Hey there @@SyedAbdulAzeemSF4852! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
kubaflo
left a comment
There was a problem hiding this comment.
Could you please check the ai's suggestions?
Surveyed all 42 maui-copilot (def 27723) builds on improved-reviewer and found two classes of false-FAILED gate verdicts that should be INCONCLUSIVE: 1. New-snapshot VisualTest PRs (e.g. PR #36448, build 14627406): a run that reports SOME real passes AND failures where every failure is a brand-new VerifyScreenshot with no committed baseline ("Baseline snapshot not yet created") took the trust-the-counts path in Get-TestResultFromOutput and returned a plain N-test FAIL, never reaching the baseline-missing check lower in the function (Passed=2, Failed=30 -> FAILED). Now, inside that path, if baseline-missing occurrences >= failCount the run is classified SnapshotBaselineMissing (INCONCLUSIVE). A real pixel diff against an EXISTING baseline prints 'Snapshot different than baseline' (not 'not yet created'), so mixed/real-diff runs still correctly FAIL. 2. Device-test APP_CRASH (PR #36472, build 14627403): both without-fix and with-fix crashed identically with 'XHarness exit code: 80 (APP_CRASH)' and Failed=0 (app died during instrumentation, no test result) yet the pair was scored a genuine FAILED. Added exit-80 to the env-error patterns so an app crash is treated as infra/INCONCLUSIVE, consistent with the existing exit-83/78 and 'Application test run crashed' handling. Both convert false-FAILED -> non-blocking INCONCLUSIVE. Unit-tested 6 scenarios (new-snapshots, real-diff guard, mixed guard, clean pass, exit-80, exit-83 regression) — all pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 3 findings
See inline comments for details.
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 2 findings
See inline comments for details.
kubaflo
left a comment
There was a problem hiding this comment.
If it ready? It has [wip] in the title, so I'd rather ask :)
There was a problem hiding this comment.
Pull request overview
Fixes iOS/MacCatalyst Entry clear button (✕) tinting so it no longer appears dimmed when TextColor is set, aligning the rendered glyph opacity with the entry text.
Changes:
- Adjusts clear-button tint image generation to draw a bitmap-backed
UIImagebefore applying theSourceIntint fill, avoiding unintended alpha reduction. - Adds an iOS/MacCatalyst device test that asserts the tinted clear-button image contains fully opaque pixels (max alpha = 255).
Reviewed changes
Copilot reviewed 2 out of 17 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Core/src/Platform/iOS/TextFieldExtensions.cs | Updates clear-button tint rendering to avoid reduced-alpha rasterization and preserve the expected visual intensity. |
| src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs | Adds a regression test validating clear-button tint opacity when TextColor is applied. |
| var bitmapImage = image.CGImage is CGImage cgImage | ||
| ? new UIImage(cgImage, image.CurrentScale, image.Orientation) | ||
| : image; | ||
| // bitmapImage's Size can be smaller than the original image's Size, so drawing it at | ||
| // CGPoint.Empty shifts it to the top-left instead of centering it. Center it manually |
| const int bitsPerComponent = 8; | ||
| const int bytesPerPixel = 4; // R, G, B, A (CGImageAlphaInfo.PremultipliedLast) | ||
| const int alphaByteOffset = 3; // A is the 4th byte within each RGBA pixel | ||
|
|
||
| var cgImage = image.CGImage; | ||
| Assert.NotNull(cgImage); | ||
|
|
||
| var width = (int)cgImage.Width; | ||
| var height = (int)cgImage.Height; | ||
| var bytesPerRow = width * bytesPerPixel; | ||
| var pixels = new byte[height * bytesPerRow]; | ||
|
|
||
| using var colorSpace = CGColorSpace.CreateDeviceRGB(); | ||
| using (var context = new CGBitmapContext(pixels, width, height, bitsPerComponent, bytesPerRow, colorSpace, CGImageAlphaInfo.PremultipliedLast)) | ||
| { | ||
| context.DrawImage(new CGRect(0, 0, width, height), cgImage); | ||
| } | ||
|
|
a4223bb to
c4e03cc
Compare
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
… TextColor (#36472) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - When an Entry control has a TextColor set and ClearButtonVisibility is enabled, the clear button (✕) appears faded/dimmed compared to the TextColor. ### Root Cause - The clear button's image was being drawn directly into the tinting context at reduced opacity, and because CGBlendMode.SourceIn compositing caps the final color's alpha at the alpha of the shape it's masking against, that reduced opacity carried through to the final tinted color — making the clear button appear dim instead of matching TextColor at full opacity. ### Description of Change - In GetClearButtonTintImage (TextFieldExtensions.cs), the code now builds a plain UIImage from the clear button image's underlying CGImage (preserving CurrentScale and Orientation) and draws that bitmap-backed copy instead of drawing the original image directly, before the existing SourceIn color-fill step — the clear button image now renders with full opacity. ### Issues Fixed Fixes #35517 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Platform | Before | After | |----------|----------|----------| | iOS | <img src="https://github.com/user-attachments/assets/3f4ac9be-0ec8-429b-8bdd-d381163d8119"> | <img src="https://github.com/user-attachments/assets/4a8897c3-0fc0-4ebf-9bf7-0aef1d359dff"> | | Mac | <img src="https://github.com/user-attachments/assets/2a6c890a-7a72-4d5c-b7c8-fbbd6fa4cb32"> | <img src="https://github.com/user-attachments/assets/2a2318a4-b1dd-4ef5-8907-20befb57c907"> |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details
Root Cause
Description of Change
Issues Fixed
Fixes #35517
Validated the behaviour in the following platforms
Output