feat: add AI style - Colorful & Gradient to TagLabel.

This commit is contained in:
Zhang Dian
2025-11-11 18:17:47 +08:00
parent 5f8357ecbc
commit 7a831d35f7
6 changed files with 165 additions and 78 deletions

View File

@@ -75,7 +75,16 @@
<Label Classes="Solid Grey" Theme="{StaticResource TagLabel}">Grey</Label>
<Label Classes="Solid White" Theme="{StaticResource TagLabel}">White</Label>
</WrapPanel>
<WrapPanel>
<Label Classes="Colorful Gradient" Theme="{DynamicResource TagLabel}">AI</Label>
<Label Classes="Colorful Gradient Ghost" Theme="{DynamicResource TagLabel}">AI</Label>
<Label Classes="Colorful Gradient Solid" Theme="{DynamicResource TagLabel}">AI</Label>
</WrapPanel>
<WrapPanel>
<Label Classes="Colorful" Theme="{DynamicResource TagLabel}">AI</Label>
<Label Classes="Colorful Ghost" Theme="{DynamicResource TagLabel}">AI</Label>
<Label Classes="Colorful Solid" Theme="{DynamicResource TagLabel}">AI</Label>
</WrapPanel>
</StackPanel>
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type Label}" TargetType="Label">
@@ -162,6 +171,7 @@
<!-- Shape: Square,Circle. Default is Square -->
<!-- Size: Small, Large. Default is Small -->
<!-- Color: Red, Pink, Purple, Violet, Indigo, Blue, LightBlue, Cyan, Teal, Green, LightGreen, Lime, Yellow, Amber, Orange, Grey, White. Default is Grey -->
<!-- AI style: Colorful, Gradient -->
<ControlTheme x:Key="TagLabel" TargetType="Label">
<Setter Property="BorderThickness" Value="{DynamicResource LabelTagBorderThickness}" />
<Setter Property="MinHeight" Value="{DynamicResource LabelTagSmallHeight}" />
@@ -395,5 +405,34 @@
<Setter Property="BorderBrush" Value="{DynamicResource LabelTagSolidWhiteBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource LabelTagSolidWhiteBackground}" />
</Style>
<Style Selector="^.Colorful">
<Setter Property="FontWeight" Value="{StaticResource LabelTagColorfulFontWeight}" />
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulLightForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulLightBackground}" />
<Style Selector="^.Ghost">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulGhostForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulGhostBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource LabelTagColorfulGhostBorderBrush}" />
</Style>
<Style Selector="^.Solid">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulSolidBackground}" />
</Style>
<Style Selector="^.Gradient">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulGradientLightForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulGradientLightBackground}" />
<Style Selector="^.Ghost">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulGradientGhostForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulGradientGhostBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource LabelTagColorfulGradientGhostBorderBrush}" />
</Style>
<Style Selector="^.Solid">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulGradientSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulGradientSolidBackground}" />
</Style>
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -88,6 +88,21 @@
<StaticResource x:Key="LabelTagSolidWhiteBackground" ResourceKey="SemiColorBackground4" />
<SolidColorBrush x:Key="LabelTagSolidWhiteBorderBrush" Opacity="0.7" Color="{StaticResource SemiGrey2Color}" />
<StaticResource x:Key="LabelTagColorfulLightForeground" ResourceKey="SemiColorAIPurple" />
<StaticResource x:Key="LabelTagColorfulLightBackground" ResourceKey="SemiAIPurple0" />
<StaticResource x:Key="LabelTagColorfulGhostForeground" ResourceKey="SemiColorAIPurple" />
<StaticResource x:Key="LabelTagColorfulGhostBackground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="LabelTagColorfulGhostBorderBrush" ResourceKey="SemiColorAIPurple" />
<StaticResource x:Key="LabelTagColorfulSolidForeground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="LabelTagColorfulSolidBackground" ResourceKey="SemiColorAIPurple" />
<StaticResource x:Key="LabelTagColorfulGradientLightForeground" ResourceKey="SemiColorAIGeneral" />
<StaticResource x:Key="LabelTagColorfulGradientLightBackground" ResourceKey="SemiAIGeneral0" />
<StaticResource x:Key="LabelTagColorfulGradientGhostForeground" ResourceKey="SemiColorAIGeneral" />
<StaticResource x:Key="LabelTagColorfulGradientGhostBackground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="LabelTagColorfulGradientGhostBorderBrush" ResourceKey="SemiColorAIGeneral" />
<StaticResource x:Key="LabelTagColorfulGradientSolidForeground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="LabelTagColorfulGradientSolidBackground" ResourceKey="SemiColorAIGeneral" />
<!-- Obsolete -->
<StaticResource x:Key="LabelTagLightWhiteForeground" ResourceKey="LabelTagSolidWhiteForeground" />
<StaticResource x:Key="LabelTagLightWhiteBackground" ResourceKey="LabelTagSolidWhiteBackground" />

View File

@@ -88,6 +88,21 @@
<StaticResource x:Key="LabelTagSolidWhiteBackground" ResourceKey="SemiColorBackground4" />
<SolidColorBrush x:Key="LabelTagSolidWhiteBorderBrush" Opacity="0.7" Color="{StaticResource SemiGrey2Color}" />
<StaticResource x:Key="LabelTagColorfulLightForeground" ResourceKey="SemiColorAIPurple" />
<StaticResource x:Key="LabelTagColorfulLightBackground" ResourceKey="SemiAIPurple0" />
<StaticResource x:Key="LabelTagColorfulGhostForeground" ResourceKey="SemiColorAIPurple" />
<StaticResource x:Key="LabelTagColorfulGhostBackground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="LabelTagColorfulGhostBorderBrush" ResourceKey="SemiColorAIPurple" />
<StaticResource x:Key="LabelTagColorfulSolidForeground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="LabelTagColorfulSolidBackground" ResourceKey="SemiColorAIPurple" />
<StaticResource x:Key="LabelTagColorfulGradientLightForeground" ResourceKey="SemiColorAIGeneral" />
<StaticResource x:Key="LabelTagColorfulGradientLightBackground" ResourceKey="SemiAIGeneral0" />
<StaticResource x:Key="LabelTagColorfulGradientGhostForeground" ResourceKey="SemiColorAIGeneral" />
<StaticResource x:Key="LabelTagColorfulGradientGhostBackground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="LabelTagColorfulGradientGhostBorderBrush" ResourceKey="SemiColorAIGeneral" />
<StaticResource x:Key="LabelTagColorfulGradientSolidForeground" ResourceKey="SemiColorWhite" />
<StaticResource x:Key="LabelTagColorfulGradientSolidBackground" ResourceKey="SemiColorAIGeneral" />
<!-- Obsolete -->
<StaticResource x:Key="LabelTagLightWhiteForeground" ResourceKey="LabelTagSolidWhiteForeground" />
<StaticResource x:Key="LabelTagLightWhiteBackground" ResourceKey="LabelTagSolidWhiteBackground" />

View File

@@ -8,4 +8,5 @@
<StaticResource x:Key="LabelTagFontWeight" ResourceKey="SemiFontWeightRegular" />
<StaticResource x:Key="LabelTagSquareCornerRadius" ResourceKey="SemiBorderRadiusSmall" />
<StaticResource x:Key="LabelTagCircleCornerRadius" ResourceKey="SemiBorderRadiusFull" />
<StaticResource x:Key="LabelTagColorfulFontWeight" ResourceKey="SemiFontWeightBold" />
</ResourceDictionary>