unoplatform / Uno.Themes

This library is designed to help you use the Material, Fluent or Cupertino design system with the Uno Platform
https://platform.uno
Apache License 2.0
170 stars 33 forks source link

Button and TextBlock text not centred vertically correctly with Material on WinUI #941

Open nickrandolph opened 1 year ago

nickrandolph commented 1 year ago

Current behavior

Place Button and TextBlock adjacent to each other with TextBlock using BodySmall style.

<StackPanel Orientation="Horizontal"
            HorizontalAlignment="Center"
            VerticalAlignment="Stretch">
    <Button VerticalAlignment="Center">Click Me</Button>
    <TextBlock Text="Click Me"
                VerticalAlignment="Center"
                Style="{StaticResource BodySmall}"/>
    <Button VerticalAlignment="Center"
            Style="{StaticResource FilledTonalButtonStyle}">Click Me</Button>
</StackPanel>

image

Expected behavior

Text in Buttons and TextBlock should be centre aligned. This is the case for the above code snippet without the BodySmall style

image

Nuget Package: Uno.Toolkit.WinUI.Material Package Version(s): 2.5.0-dev.35

Affected platform(s): (only tested on WinUI)

nickrandolph commented 1 year ago

cc @NVLudwig this may be related to the text alignment issue we are seeing the Customize button on Windows

nickrandolph commented 1 year ago

Another example, this time using DisplayLarge as the style for the TextBlock image