Skip to content

[Net10] [iOS] Enable sizing back/flyout icon with the FontImageSource size property#30962

Merged
PureWeen merged 5 commits intodotnet:net10.0from
kubaflo:net10-hamburger-icon-font-image-source
Aug 2, 2025
Merged

[Net10] [iOS] Enable sizing back/flyout icon with the FontImageSource size property#30962
PureWeen merged 5 commits intodotnet:net10.0from
kubaflo:net10-hamburger-icon-font-image-source

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Jul 31, 2025

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!

Description of Change

The PR #26016 resolved a sizing issue with excessively large floating icons. However, as a side effect, the Size property of FontImageSource is now ignored, which can be confusing for developers.

For example:

<FontImageSource
         Size="40"
         FontFamily="OpenSansSemibold"
         Glyph="&#x2039;"/>

Even though Size is explicitly set to 40, it's currently not respected.

To reduce confusion and improve developer experience we should restore support for the Size property when it is explicitly specified.

Issues Fixed

Fixes #30946

Before After
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Maui.Controls.Sample.DetailPage"
             Shell.ForegroundColor="Red"
             IconImageSource="groceries.png"
             xmlns:local="clr-namespace:Maui.Controls.Sample">
    <Shell.BackButtonBehavior>
        <BackButtonBehavior
            Command="{Binding BackCommand}"
            IsEnabled="True"
            IsVisible="True">
            <BackButtonBehavior.IconOverride>
                <FontImageSource
                    Size="40"
                    FontFamily="OpenSansSemibold"
                    Glyph="&#x2039;"/>
            </BackButtonBehavior.IconOverride>
        </BackButtonBehavior>
    </Shell.BackButtonBehavior>

    <Button
        Text="Navigate"
        Command="{Binding NavigateToAnotherPageCommand}"/>
</ContentPage>

Copilot AI review requested due to automatic review settings July 31, 2025 23:40
@kubaflo kubaflo requested a review from a team as a code owner July 31, 2025 23:40
@kubaflo kubaflo requested review from jsuarezruiz and rmarinho July 31, 2025 23:40
@kubaflo kubaflo changed the base branch from main to net10.0 July 31, 2025 23:40
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jul 31, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses an issue where back arrows and toolbar icons have become unusually small on iOS. The fix adds proper size handling for font-based icons by checking if a FontImageSource has an explicit size set before applying automatic resizing.

  • Adds conditional checks to prevent automatic resizing of FontImageSource icons when they have explicit size properties
  • Preserves existing resizing behavior for other image types and FontImageSource without explicit sizing
  • Fixes bracket placement and code structure in affected resizing logic

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs Adds FontImageSource size check before resizing toolbar icons and fixes bracket structure
src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs Adds FontImageSource size check before resizing flyout icons with proper bracket structure

@kubaflo kubaflo changed the title [.NET10]G4: back arrow has become unusually smallB [Net10] [iOS] Enable sizing back/hamburger icon with the FontImageSource size property Jul 31, 2025
@kubaflo kubaflo changed the title [Net10] [iOS] Enable sizing back/hamburger icon with the FontImageSource size property [Net10] [iOS] Enable sizing back/flyout icon with the FontImageSource size property Jul 31, 2025
@kubaflo kubaflo self-assigned this Jul 31, 2025
@kubaflo kubaflo added platform/ios area-controls-shell Shell Navigation, Routes, Tabs, Flyout shell-flyout labels Jul 31, 2025
@PureWeen
Copy link
Member

PureWeen commented Aug 1, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

PureWeen commented Aug 1, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

PureWeen
PureWeen previously approved these changes Aug 1, 2025
@PureWeen
Copy link
Member

PureWeen commented Aug 1, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen merged commit 38c0051 into dotnet:net10.0 Aug 2, 2025
129 checks passed
@PureWeen PureWeen added this to the .NET 10.0-preview7 milestone Aug 2, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution platform/ios shell-flyout

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants