chore(style): add Label small style.

This commit is contained in:
NaBian committed 2022-10-09 22:52:28 +08:00
1 parent ce7ba1dc60
commit 3876444176
5 files changed
+107 -12

No files matched your search

@@ -1384,6 +1384,7 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Label">
@@ -3420,25 +3421,50 @@
</Style>
<Style x:Key="TextBlockDefaultBold" BasedOn="{StaticResource TextBlockBoldBaseStyle}" TargetType="TextBlock" />
<Style BasedOn="{StaticResource HighlightTextBlockBaseStyle}" TargetType="hc:HighlightTextBlock" />
<Style BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Style x:Key="LabelDefault" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style BasedOn="{StaticResource LabelDefault}" TargetType="Label" />
<Style x:Key="LabelDefault.Small" BasedOn="{StaticResource LabelDefault}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" />
</Style>
<Style x:Key="LabelPrimary" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
</Style>
<Style x:Key="LabelPrimary.Small" BasedOn="{StaticResource LabelPrimary}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" />
</Style>
<Style x:Key="LabelSuccess" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource SuccessBrush}" />
</Style>
<Style x:Key="LabelSuccess.Small" BasedOn="{StaticResource LabelSuccess}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" />
</Style>
<Style x:Key="LabelInfo" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource InfoBrush}" />
</Style>
<Style x:Key="LabelInfo.Small" BasedOn="{StaticResource LabelInfo}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" />
</Style>
<Style x:Key="LabelWarning" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource WarningBrush}" />
</Style>
<Style x:Key="LabelWarning.Small" BasedOn="{StaticResource LabelWarning}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" />
</Style>
<Style x:Key="LabelDanger" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource DangerBrush}" />
</Style>
<Style x:Key="LabelDanger.Small" BasedOn="{StaticResource LabelDanger}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" />
</Style>
<Style BasedOn="{StaticResource CompareSliderBaseStyle}" TargetType="hc:CompareSlider" />
<Style BasedOn="{StaticResource PreviewSliderBaseStyle}" TargetType="hc:PreviewSlider" />
<Style x:Key="ToggleButtonDefault" BasedOn="{StaticResource ToggleButtonBaseStyle}" TargetType="ToggleButton">
@@ -6,13 +6,23 @@
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
Background="{DynamicResource RegionBrush}">
<hc:TransitioningContentControl>
<StackPanel Margin="32">
<Label HorizontalAlignment="Left" Margin="5" Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}"/>
<Label HorizontalAlignment="Left" Margin="5" Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelDanger}"/>
<Label HorizontalAlignment="Left" Margin="5" Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelInfo}"/>
<Label HorizontalAlignment="Left" Margin="5" Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelPrimary}"/>
<Label HorizontalAlignment="Left" Margin="5" Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelSuccess}"/>
<Label HorizontalAlignment="Left" Margin="5" Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelWarning}"/>
</StackPanel>
<hc:UniformSpacingPanel Margin="32" Spacing="32" ChildWrapping="Wrap">
<hc:UniformSpacingPanel Spacing="5" Orientation="Vertical">
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelDanger}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelInfo}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelPrimary}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelSuccess}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelWarning}" />
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="5" Orientation="Vertical">
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelDefault.Small}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelDanger.Small}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelInfo.Small}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelPrimary.Small}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelSuccess.Small}" />
<Label Content="{ex:Lang Key={x:Static langs:LangKeys.Title},Converter={StaticResource StringRepeatConverter},ConverterParameter=10}" Style="{StaticResource LabelWarning.Small}" />
</hc:UniformSpacingPanel>
</hc:UniformSpacingPanel>
</hc:TransitioningContentControl>
</UserControl>
@@ -12,6 +12,7 @@
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Label">
@@ -1,29 +1,61 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Style x:Key="LabelDefault" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style BasedOn="{StaticResource LabelDefault}" TargetType="Label" />
<Style x:Key="LabelDefault.Small" BasedOn="{StaticResource LabelDefault}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelPrimary" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
</Style>
<Style x:Key="LabelPrimary.Small" BasedOn="{StaticResource LabelPrimary}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelSuccess" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
</Style>
<Style x:Key="LabelSuccess.Small" BasedOn="{StaticResource LabelSuccess}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelInfo" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
</Style>
<Style x:Key="LabelInfo.Small" BasedOn="{StaticResource LabelInfo}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelWarning" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
</Style>
<Style x:Key="LabelWarning.Small" BasedOn="{StaticResource LabelWarning}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelDanger" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
<Setter Property="Background" Value="{DynamicResource DangerBrush}" />
</Style>
<Style x:Key="LabelDanger.Small" BasedOn="{StaticResource LabelDanger}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
</ResourceDictionary>
@@ -1384,6 +1384,7 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Label">
@@ -3420,25 +3421,50 @@
</Style>
<Style x:Key="TextBlockDefaultBold" BasedOn="{StaticResource TextBlockBoldBaseStyle}" TargetType="TextBlock" />
<Style BasedOn="{StaticResource HighlightTextBlockBaseStyle}" TargetType="hc:HighlightTextBlock" />
<Style BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Style x:Key="LabelDefault" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style BasedOn="{StaticResource LabelDefault}" TargetType="Label" />
<Style x:Key="LabelDefault.Small" BasedOn="{StaticResource LabelDefault}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelPrimary" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
</Style>
<Style x:Key="LabelPrimary.Small" BasedOn="{StaticResource LabelPrimary}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelSuccess" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource SuccessBrush}" />
</Style>
<Style x:Key="LabelSuccess.Small" BasedOn="{StaticResource LabelSuccess}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelInfo" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource InfoBrush}" />
</Style>
<Style x:Key="LabelInfo.Small" BasedOn="{StaticResource LabelInfo}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelWarning" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource WarningBrush}" />
</Style>
<Style x:Key="LabelWarning.Small" BasedOn="{StaticResource LabelWarning}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style x:Key="LabelDanger" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource DangerBrush}" />
</Style>
<Style x:Key="LabelDanger.Small" BasedOn="{StaticResource LabelDanger}" TargetType="Label">
<Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,0" />
</Style>
<Style BasedOn="{StaticResource CompareSliderBaseStyle}" TargetType="hc:CompareSlider" />
<Style BasedOn="{StaticResource PreviewSliderBaseStyle}" TargetType="hc:PreviewSlider" />
<Style x:Key="ToggleButtonDefault" BasedOn="{StaticResource ToggleButtonBaseStyle}" TargetType="ToggleButton">