View Issue Details

IDProjectCategoryView StatusLast Update
0001460NoesisGUIC# SDKpublic2019-05-08 15:20
Reporterai_enabledAssigned Tosfernandez 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version2.2.1 
Target VersionFixed in Version 
Summary0001460: Line height support for TextBox
DescriptionHi guys,
there is a known workaround to enable line height for TextBox. Alas, it doesn't work with NoesisGUI
https://social.msdn.microsoft.com/Forums/vstudio/en-US/563a8558-fe84-486d-8f40-9a5494884f25/controlling-lineheight-for-textboxes?forum=wpf

Please let me know if there is any other workaround or you could make it work in the future versions.

Regards!
TagsNo tags attached.
PlatformAny

Activities

sfernandez

sfernandez

2019-05-06 10:41

manager   ~0005662

I verified that LineHeight property is applied to the TextBox, but I see that the caret (and selection) is also affected by that property and that is not correct, we will fix it.
ai_enabled

ai_enabled

2019-05-06 17:17

updater   ~0005663

Hmm, I cannot make it work in 2.2.2... still the same line height.
I'm using this style:

<Style x:Key="ChatTextBoxStyle" TargetType="{x:Type TextBox}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Height" Value="Auto" />
        <Setter Property="Padding" Value="2,0,2,3" />
        <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontSize" Value="12.5" />
        <Setter Property="TextBlock.LineHeight" Value="13" />
        <Setter Property="TextBlock.LineStackingStrategy" Value="BlockLineHeight" />
        <Setter Property="AcceptsReturn" Value="False" />
        <Setter Property="AcceptsTab" Value="True" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Foreground" Value="{StaticResource ChatBrushFromCurrentPlayer}" />
        <Setter Property="Background" Value="{StaticResource ChatEntryBackground}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="SelectionBrush" Value="{StaticResource BrushColor7}" />
        <Setter Property="CaretBrush" Value="{StaticResource BrushColor7}" />
        <Setter Property="SelectionOpacity" Value="0.5" />
        <Setter Property="ContextMenu">
            <Setter.Value>
                <!-- No context menu -->
                <ContextMenu IsEnabled="False" />
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <StackPanel Orientation="Vertical"
                                Background="{TemplateBinding Background}">
                        <Control Style="{StaticResource ControlHorizontalSeparator}"
                                 Height="4"
                                 Margin="0"
                                 VerticalAlignment="Center" />
                        <Border BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Padding="{TemplateBinding Padding}">
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost" />
                        </Border>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
sfernandez

sfernandez

2019-05-08 13:26

manager   ~0005665

I found that LineStackingStrategy property was not inherited, so that setter didn't work. That made setting a line height smaller than the default one didn't affect the effective height of the line. It worked for bigger LineHeight values like 40, though.

Anyway, I fixed the inheritance problem in LineStackingStrategy and line height will work fine in next release.
ai_enabled

ai_enabled

2019-05-08 15:20

updater   ~0005666

Awesome! Thank you, Sergio!

Regards!

Issue History

Date Modified Username Field Change
2019-05-04 19:43 ai_enabled New Issue
2019-05-06 10:39 sfernandez Assigned To => sfernandez
2019-05-06 10:39 sfernandez Status new => assigned
2019-05-06 10:41 sfernandez Note Added: 0005662
2019-05-06 17:17 ai_enabled Note Added: 0005663
2019-05-08 13:26 sfernandez Status assigned => feedback
2019-05-08 13:26 sfernandez Note Added: 0005665
2019-05-08 15:20 ai_enabled Note Added: 0005666
2019-05-08 15:20 ai_enabled Status feedback => assigned