Skip to content

fix(icons): Handle ImageIconSource in MakeIconElementFrom - #25595

Merged
MartinZikmund merged 1 commit into
unoplatform:masterfrom
buzztouniverse:fix/image-icon-source
Nov 25, 2026
Merged

MartinZikmund merged 1 commit into
unoplatform:masterfrom
buzztouniverse:fix/image-icon-source

Conversation

@buzztouniverse

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #25465

PR Type:

🐞 Bugfix

What changed? 🚀

SharedHelpers.MakeIconElementFrom handled FontIconSource, SymbolIconSource, BitmapIconSource and PathIconSource, but had no branch for ImageIconSource. It returned null for it, so TitleBar, TabViewItem, InfoBar and TeachingTip showed an empty icon slot when given an ImageIconSource.

This adds the missing branch: it creates an ImageIcon and copies ImageSource and Foreground. It sits before the BitmapIconSource branch, same order as WinUI's SharedHelpers::MakeIconElementFrom.

Also added a runtime test in Given_TitleBar that sets an ImageIconSource and checks that an ImageIcon using the same image is created.

PR Checklist ✅

The shared helper used by TitleBar, TabViewItem, InfoBar and TeachingTip
had no branch for ImageIconSource, so it returned null and the icon slot
stayed empty. Add the branch before BitmapIconSource, like WinUI does.

Fixes unoplatform#25465
@CLAassistant

CLAassistant commented Oct 20, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@MartinZikmund MartinZikmund left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @buzztouniverse! This matches WinUI's SharedHelpers::MakeIconElementFrom (controls/dev/dll/SharedHelpers.cpp) 1:1: same placement before the BitmapIconSource branch, same ImageSource/Foreground copy as ImageIconSource::CreateIconElementCore. The test goes through the real TitleBar path and fails without the fix. LGTM.

@MartinZikmund

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 247581 found UI Test snapshots differences: skia-linux-screenshots: 239, skia-windows-screenshots: 249

Details
  • skia-linux-screenshots: 239 changed over 2500

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BitmapIcon_Foreground.png-dark
    • BitmapIcon_Foreground.png
    • Buttons.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • Accessibility_Showcase.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • AppWindowTitleBar Properties.png-dark
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
    • Basics.png-dark
    • Basics.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
  • skia-windows-screenshots: 249 changed over 2500

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • Buttons.png-dark
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
    • AnimatedVisualsTestbedPage.png-dark
    • Basics.png-dark
    • Basics.png

@MartinZikmund
MartinZikmund merged commit a601ff2 into unoplatform:master Nov 25, 2026
47 checks passed
@welcome

welcome Bot commented Nov 25, 2026

Copy link
Copy Markdown

🎉 Congratulations on getting your very first pull request merged into Uno Platform! This is a huge milestone — you are now officially part of the community of contributors helping shape the future of cross-platform .NET development, and your code will reach developers and apps all over the world. 🌍

We are genuinely grateful for the time and care you put into this contribution. Every PR — big or small — makes Uno Platform better for everyone, and we hope this is the first of many. We cannot wait to see what you build next! 🚀

As a small thank-you, we would love to send you some swag so you can wear your contributor status with pride. And if you have any feedback or ideas on how we can make contributing to Uno Platform even better, please open a feedback issue — we truly value your perspective.

giphy
Welcome to the family, and merci beaucoup! 👋❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ImageIconSource is ignored by TitleBar, TabViewItem, InfoBar and TeachingTip, so the icon is blank

5 participants