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