amwx / FluentAvalonia

Control library focused on fluent design and bringing more WinUI controls into Avalonia
MIT License
1.05k stars 97 forks source link

Button ignore TextElement.FontSize #488

Closed workgroupengineering closed 9 months ago

workgroupengineering commented 1 year ago

Describe the bug

If you set the TextElement.FontSize of a Button container, the button will not honor the setting.

How reproduce:

    <UniformGrid Columns="2"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Top"
                 TextElement.FontSize="50">
        <Button Content="AAAA"
                />
        <TextBlock Text="AAAA"
                   VerticalAlignment="Center"/>
    </UniformGrid>

Screenshots

FASandbox

immagine

Avalonia Sandbox

immagine

Desktop/Platform

Additional context Add any other context about the problem here.

timunie commented 1 year ago

FontSize is set via DynamicResource here: https://github.com/amwx/FluentAvalonia/blob/759d12a67f623a15f44c18c10e0e7480a69aa8e1/src/FluentAvalonia/Styling/ControlThemes/BasicControls/ButtonStyles.axaml#L30

Overriding the resource will update button font size