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

Content of RadioButton and CheckBox does not align horizontally #8867

Open
gwalschlager opened this issue Sep 14, 2023 · 0 comments
Open

Content of RadioButton and CheckBox does not align horizontally #8867

gwalschlager opened this issue Sep 14, 2023 · 0 comments
Labels
area-RadioButtons bug Something isn't working team-Controls Issue for the Controls team

Comments

@gwalschlager
Copy link

Describe the bug

If you create a RadioButton and a CheckBox in a Grid with two columns, so that they appear side-by-side, the text content of those two controls are not at the same height.

Steps to reproduce the bug

Simply create a window with the following content which creates a side-by-side RadioButton and CheckBox with Border controls above and below to visually gauge the height of text above baseline.

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Border Grid.Row="0" Grid.ColumnSpan="2" BorderBrush="AntiqueWhite" BorderThickness="0.5" Margin="0,0,0,-10" Height="0.5"/>
        <RadioButton Grid.Row="1" Grid.Column="0" Content="XXXXXXXXX" IsTabStop="False"/>
        <CheckBox Grid.Row="1" Grid.Column="1" Content="YYYYYYYYYY" IsTabStop="False"/>
        <Border Grid.Row="2" Grid.ColumnSpan="2" BorderBrush="AntiqueWhite" BorderThickness="0.5" Margin="0,-8,0,0" Height="0.5"/>
    </Grid>

Expected behavior

The content (in this case text) of both controls should be at the same height if they are placed side-by-side.

Screenshots

image

NuGet package version

WinUI 3 - Windows App SDK 1.4.0: 1.4.230822000

Windows version

Windows 11 (22H2): Build 22621

Additional context

This may seem trivial, but it's not. This simply makes it look like your interface was made with poor attention to detail. This isn't a sub-pixel alignment issue because if you look at the screenshot, they are quite different in terms of vertical height w/respect to the borders drawn directly above and below.

@gwalschlager gwalschlager added the bug Something isn't working label Sep 14, 2023
@bpulliam bpulliam added area-RadioButtons team-Controls Issue for the Controls team labels Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-RadioButtons bug Something isn't working team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

2 participants