Wugenois
Topic Author
Posts: 15
Joined: 07 Apr 2020, 10:22

Different LineHeight in Blend and Unity

15 May 2020, 11:24

Hello,

Trying to harmonize the layout in Unity and Blend, the LineHeight seems to be interpreted differently in Blend and Unity and its a problem when the height of a control (a button for example) depends of the LineHeight.
(The property LineHeight doesn't change a thing)

Is there a solution to avoid these different interpretation ?

Thanks !
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Different LineHeight in Blend and Unity

15 May 2020, 11:25

What version of Noesis are you using?

Could you please attach images with corresponding XAML showing the differences?
 
Wugenois
Topic Author
Posts: 15
Joined: 07 Apr 2020, 10:22

Re: Different LineHeight in Blend and Unity

15 May 2020, 11:47

I use the NoesisGUI v3.0.0rc7

Here the result in Unity and Blend :
LineHeightUnityBlend.PNG
LineHeightUnityBlend.PNG (17.6 KiB) Viewed 1507 times

Here the template (whitout triggers) :
    <ControlTemplate x:Key="RoundButtonTemplate" TargetType="{x:Type ButtonBase}">
        <Border x:Name="Bg"
            Background="{TemplateBinding Background}"
            BorderBrush="{TemplateBinding BorderBrush}"
            BorderThickness="1"
            Padding="12,0,12,0"
            CornerRadius="4">
            <TextBlock Text="{TemplateBinding Content}" Margin="0,0,0,2"  x:Name="TextButton">
                <TextBlock.Effect>
                    <DropShadowEffect Color="#01020a3C" Direction="330" ShadowDepth="2" BlurRadius="4"/>
                </TextBlock.Effect>
            </TextBlock>
        </Border>
    </ControlTemplate>

Here the style which apply the template :
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultControlStyle}">
        <Setter Property="BorderBrush" Value="{StaticResource DarkCyanBrush}"/>
        <Setter Property="Background" Value="{StaticResource GdBlue}"/>
        <Setter Property="FontSize" Value="13"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="Foreground" Value="{StaticResource WhiteBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template" Value="{StaticResource RoundButtonTemplate}"/>
    </Style>
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Different LineHeight in Blend and Unity

15 May 2020, 11:58

It seems to me, you are using different fonts for Blend and Unity? Fast way to fix this is applying our theme to blend. That way the default font is the same.
 
Wugenois
Topic Author
Posts: 15
Joined: 07 Apr 2020, 10:22

Re: Different LineHeight in Blend and Unity

15 May 2020, 15:00

Ok You're right, Unity applied its default font which overides the fonts I defined in code.

Thank for bring to light this !
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Different LineHeight in Blend and Unity

15 May 2020, 15:24

Great! Glad to help

Who is online

Users browsing this forum: kashif and 12 guests