LadderSettings/FontPicker font-size-ticker resize bug

This commit is contained in:
John Colvin committed 2018-05-09 13:31:12 -04:00
1 parent 2b29a6ae17
commit 18f77215f0
2 files changed
+57 -55

No files matched your search

@@ -4,7 +4,6 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="clr-namespace:mbts.ui.controls"
Height="410"
>
<UserControl.Resources>
<Style TargetType="GroupBox" BasedOn="{StaticResource {x:Type GroupBox}}">
@@ -16,15 +15,10 @@
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="220"/>
<ColumnDefinition Width="210"/>
<ColumnDefinition Width="230"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<GroupBox Grid.RowSpan="3" Header="Font Family">
<GroupBox Header="Font Family" Height="{Binding ActualHeight, ElementName=_panel_right}">
<ListBox
x:Name="_font_family_list_box"
Background="White"
@@ -38,49 +32,57 @@
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
<GroupBox Grid.Column="1" Header="Font Weight" Margin="8,0,0,0">
<ListBox
Background="White"
ItemsSource="{Binding FontWeights, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
SelectedItem="{Binding SelectedFontWeight, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Setter Property="FontFamily" Value="{Binding SelectedFontFamily, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"/>
<Setter Property="FontWeight" Value="{Binding}"/>
<Setter Property="IsEnabled">
<Setter.Value>
<MultiBinding Converter="{StaticResource FontFamilySupportsWeightConverter}">
<Binding Path="SelectedFontFamily" RelativeSource="{RelativeSource AncestorType=c:FontPicker}"/>
<Binding/>
</MultiBinding>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4"/>
</Trigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</GroupBox>
<GroupBox Grid.Column="1" Grid.Row="1" Header="Font Size" Margin="8,8,0,0">
<c:TickUpDownDouble Value="{Binding SelectedFontSize, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"/>
</GroupBox>
<GroupBox Grid.Column="1" Grid.Row="2" Header="Sample Text" Margin="8,8,0,0">
<TextBlock
FontFamily="{Binding SelectedFontFamily, Mode=OneWay, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
FontSize="{Binding SelectedFontSize, Mode=OneWay, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
FontWeight="{Binding SelectedFontWeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
Foreground="{Binding SelectedFontColor, Mode=OneWay, RelativeSource={RelativeSource AncestorType=c:FontPicker}, Converter={StaticResource ColorToBrushConverter}}"
>
<TextBlock.Inlines>
<Run Text="BTS Spark - Make Your Move."/>
<LineBreak/>
<Run Text="999-56789.01234"/>
</TextBlock.Inlines>
</TextBlock>
</GroupBox>
<Grid x:Name="_panel_right" Grid.Column="1" Margin="8,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="220"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<GroupBox Header="Font Weight">
<ListBox
Background="White"
ItemsSource="{Binding FontWeights, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
SelectedItem="{Binding SelectedFontWeight, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Setter Property="FontFamily" Value="{Binding SelectedFontFamily, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"/>
<Setter Property="FontWeight" Value="{Binding}"/>
<Setter Property="IsEnabled">
<Setter.Value>
<MultiBinding Converter="{StaticResource FontFamilySupportsWeightConverter}">
<Binding Path="SelectedFontFamily" RelativeSource="{RelativeSource AncestorType=c:FontPicker}"/>
<Binding/>
</MultiBinding>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4"/>
</Trigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</GroupBox>
<GroupBox Grid.Row="1" Header="Font Size" Margin="0,8,0,0">
<c:TickUpDownDouble Value="{Binding SelectedFontSize, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"/>
</GroupBox>
<GroupBox Grid.Row="2" Header="Sample Text" Margin="0,8,0,0">
<TextBlock
FontFamily="{Binding SelectedFontFamily, Mode=OneWay, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
FontSize="{Binding SelectedFontSize, Mode=OneWay, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
FontWeight="{Binding SelectedFontWeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType=c:FontPicker}}"
Foreground="{Binding SelectedFontColor, Mode=OneWay, RelativeSource={RelativeSource AncestorType=c:FontPicker}, Converter={StaticResource ColorToBrushConverter}}"
TextWrapping="Wrap"
>
<TextBlock.Inlines>
<Run Text="BTS Spark - Make Your Move."/>
<LineBreak/>
<Run Text="999-56789.01234"/>
</TextBlock.Inlines>
</TextBlock>
</GroupBox>
</Grid>
</Grid>
</UserControl>
@@ -48,8 +48,8 @@
<ColumnDefinition Width="Auto" SharedSizeGroup="c0"/>
<ColumnDefinition SharedSizeGroup="c1"/>
<ColumnDefinition SharedSizeGroup="c2"/>
<ColumnDefinition Width="Auto" MinWidth="145" SharedSizeGroup="c3"/>
<ColumnDefinition SharedSizeGroup="c4"/>
<ColumnDefinition Width="212" SharedSizeGroup="c3"/>
<ColumnDefinition Width="140" SharedSizeGroup="c4"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Background="{u:BTSColor header}" Padding="6,3">
<TextBlock VerticalAlignment="Center" Text="{Binding name}" Foreground="{u:BTSColor header_text}"/>