Skip to content
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

Defining a FontSize in a FontIcon should not be overridden by its VisualParent's #1244

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Only apply the VisualParent override if its size isn't the default we…
… just replaced
  • Loading branch information
Difegue committed Oct 1, 2024
commit 4140b44a81d1e9474e0ff566810d2f4c5834755e
2 changes: 1 addition & 1 deletion src/Wpf.Ui/Controls/IconElement/FontIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected override UIElement InitializeChildren()
SetResourceReference(FontSizeProperty, "DefaultIconFontSize");

// If the FontSize is the default, set it to the parent's FontSize.
if (VisualParent is not null)
if (VisualParent is not null && TextElement.GetFontSize(VisualParent) != SystemFonts.MessageFontSize)
{
SetCurrentValue(FontSizeProperty, TextElement.GetFontSize(VisualParent));
}
Expand Down
Loading