fix: set minwidth instead of width.
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<StackPanel Margin="20">
|
<StackPanel Margin="20">
|
||||||
<TextBlock Text="Accept all keys" />
|
<TextBlock Text="Accept all keys" />
|
||||||
<u:KeyGestureInput Width="300" HorizontalAlignment="Left" />
|
<u:KeyGestureInput HorizontalAlignment="Left" />
|
||||||
<TextBlock Text="Accept only A,B and C" />
|
<TextBlock Text="Accept only A,B and C" />
|
||||||
<u:KeyGestureInput
|
<u:KeyGestureInput
|
||||||
Width="300"
|
Width="300"
|
||||||
@@ -22,5 +22,6 @@
|
|||||||
Classes="ClearButton"
|
Classes="ClearButton"
|
||||||
InnerLeftContent="Attack"
|
InnerLeftContent="Attack"
|
||||||
InnerRightContent="Default" />
|
InnerRightContent="Default" />
|
||||||
|
<u:KeyGestureInput HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -7,12 +7,13 @@
|
|||||||
<converters:PlatformKeyGestureConverter x:Key="KeyGestureConverter" />
|
<converters:PlatformKeyGestureConverter x:Key="KeyGestureConverter" />
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type u:KeyGestureInput}" TargetType="u:KeyGestureInput">
|
<ControlTheme x:Key="{x:Type u:KeyGestureInput}" TargetType="u:KeyGestureInput">
|
||||||
<Setter Property="Width" Value="{DynamicResource KeyGestureInputWidth}" />
|
<Setter Property="MinWidth" Value="{DynamicResource KeyGestureInputWidth}" />
|
||||||
<Setter Property="Height" Value="{DynamicResource KeyGestureInputHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource KeyGestureInputHeight}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource KeyGestureInputBackground}" />
|
<Setter Property="Background" Value="{DynamicResource KeyGestureInputBackground}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource KeyGestureInputBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource KeyGestureInputBorderBrush}" />
|
||||||
<Setter Property="BorderThickness" Value="{DynamicResource KeyGestureInputBorderThickness}" />
|
<Setter Property="BorderThickness" Value="{DynamicResource KeyGestureInputBorderThickness}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource KeyGestureInputCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource KeyGestureInputCornerRadius}" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
|
||||||
<Setter Property="Padding" Value="8 0" />
|
<Setter Property="Padding" Value="8 0" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="u:KeyGestureInput">
|
<ControlTemplate TargetType="u:KeyGestureInput">
|
||||||
@@ -25,8 +26,8 @@
|
|||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<Panel VerticalAlignment="Stretch" Margin="{TemplateBinding Padding}">
|
<Panel VerticalAlignment="Stretch" Margin="{TemplateBinding Padding}">
|
||||||
<DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
<Grid ColumnDefinitions="Auto, *, Auto" >
|
||||||
<ContentPresenter
|
<ContentPresenter Grid.Column="0"
|
||||||
Content="{TemplateBinding InnerLeftContent}"
|
Content="{TemplateBinding InnerLeftContent}"
|
||||||
Padding="{TemplateBinding Padding, Converter={x:Static ursaConverters:ThicknessIncludeConverter.Right}}"
|
Padding="{TemplateBinding Padding, Converter={x:Static ursaConverters:ThicknessIncludeConverter.Right}}"
|
||||||
DockPanel.Dock="Left"
|
DockPanel.Dock="Left"
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
IsVisible="{Binding Path=InnerLeftContent, RelativeSource={RelativeSource TemplatedParent},
|
IsVisible="{Binding Path=InnerLeftContent, RelativeSource={RelativeSource TemplatedParent},
|
||||||
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
|
Grid.Column="2"
|
||||||
Content="{TemplateBinding InnerRightContent}"
|
Content="{TemplateBinding InnerRightContent}"
|
||||||
DockPanel.Dock="Right"
|
DockPanel.Dock="Right"
|
||||||
Padding="{TemplateBinding Padding, Converter={x:Static ursaConverters:ThicknessIncludeConverter.Left}}"
|
Padding="{TemplateBinding Padding, Converter={x:Static ursaConverters:ThicknessIncludeConverter.Left}}"
|
||||||
@@ -45,11 +47,12 @@
|
|||||||
IsVisible="{Binding Path=InnerRightContent, RelativeSource={RelativeSource TemplatedParent},
|
IsVisible="{Binding Path=InnerRightContent, RelativeSource={RelativeSource TemplatedParent},
|
||||||
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
|
Grid.Column="1"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Text="{TemplateBinding Gesture,
|
Text="{TemplateBinding Gesture,
|
||||||
Converter={StaticResource KeyGestureConverter}}" />
|
Converter={StaticResource KeyGestureConverter}}" />
|
||||||
<Button
|
<Button Grid.Column="0" Grid.ColumnSpan="3"
|
||||||
Name="PART_ClearButton"
|
Name="PART_ClearButton"
|
||||||
Margin="0,0,8,0"
|
Margin="0,0,8,0"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
@@ -57,7 +60,7 @@
|
|||||||
Focusable="False"
|
Focusable="False"
|
||||||
IsVisible="False"
|
IsVisible="False"
|
||||||
Theme="{DynamicResource InputClearButton}" />
|
Theme="{DynamicResource InputClearButton}" />
|
||||||
</DockPanel>
|
</Grid>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Border>
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|||||||
Reference in New Issue
Block a user