feat: Foreground.

This commit is contained in:
Zhang Dian
2024-06-07 11:04:06 +08:00
parent 34568a4af8
commit 0b72578de1
4 changed files with 5 additions and 6 deletions

View File

@@ -35,6 +35,7 @@
Value="{Binding Value}"
Count="{Binding Count}"
DefaultValue="{Binding DefaultValue}"
Foreground="{StaticResource SemiRed5}"
Character="{StaticResource LoveHeartGeometry}" />
</StackPanel>
</Grid>

View File

@@ -15,6 +15,7 @@
Data="{TemplateBinding Character}"
Fill="{TemplateBinding Background}" />
<Border Name="{x:Static u:RatingCharacter.PART_IconGlyph}"
IsVisible="False"
ClipToBounds="True">
<Path Width="24"
Height="24"
@@ -30,15 +31,14 @@
<Style Selector="^:pointerover">
<Setter Property="RenderTransform" Value="scale(1.1)" />
</Style>
<Style Selector="^:selected">
<Setter Property="Foreground" Value="{DynamicResource RatingCharacterForeground}" />
<Style Selector="^:selected /template/ Border#PART_IconGlyph">
<Setter Property="IsVisible" Value="True" />
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:Rating}" TargetType="u:Rating">
<Setter Property="Foreground" Value="{DynamicResource RatingCharacterUnSelectedForeground}" />
<Setter Property="Foreground" Value="{DynamicResource RatingCharacterForeground}" />
<Setter Property="Character" Value="{DynamicResource RatingStarIconGlyph}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="ItemTemplate">
<DataTemplate>
<u:RatingCharacter />

View File

@@ -1,5 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="RatingCharacterUnSelectedForeground" Color="Transparent" />
<SolidColorBrush x:Key="RatingCharacterForeground" Color="#FDDE43" />
<SolidColorBrush x:Key="RatingCharacterBackground" Opacity="0.12" Color="White" />
</ResourceDictionary>

View File

@@ -1,5 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="RatingCharacterUnSelectedForeground" Color="Transparent" />
<SolidColorBrush x:Key="RatingCharacterForeground" Color="#FAC800" />
<SolidColorBrush x:Key="RatingCharacterBackground" Opacity="0.05" Color="#2E3238" />
</ResourceDictionary>