Merge pull request #125 from irihitech/issue/124

Fix BadgeContentForeground
This commit is contained in:
Dong Bin
2024-02-26 20:56:43 +08:00
committed by GitHub
4 changed files with 274 additions and 146 deletions

View File

@@ -5,8 +5,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa" xmlns:u="https://irihi.tech/ursa"
d:DesignHeight="450" d:DesignHeight="850"
d:DesignWidth="800" d:DesignWidth="850"
mc:Ignorable="d"> mc:Ignorable="d">
<ScrollViewer HorizontalScrollBarVisibility="Auto"> <ScrollViewer HorizontalScrollBarVisibility="Auto">
<StackPanel <StackPanel
@@ -17,10 +17,14 @@
<StackPanel.Styles> <StackPanel.Styles>
<Style Selector="u|Badge"> <Style Selector="u|Badge">
<Setter Property="Margin" Value="14" /> <Setter Property="Margin" Value="14" />
</Style> <Style Selector="^ Border">
<Style Selector="u|Badge > Border"> <Setter Property="Background" Value="{DynamicResource SemiOrange3}" />
<Setter Property="Background" Value="Orange" /> <Setter Property="CornerRadius" Value="8" />
<Setter Property="CornerRadius" Value="8" /> <Style Selector="^ TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</Style>
</Style> </Style>
</StackPanel.Styles> </StackPanel.Styles>
@@ -29,26 +33,38 @@
HorizontalAlignment="Center" HorizontalAlignment="Center"
Header="500" Header="500"
OverflowCount="100"> OverflowCount="100">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="SUCCEED!"> <u:Badge Header="SUCCEED!">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="Hello" /> <u:Badge Header="Hello" />
<u:Badge Header="Hello" Dot="True" /> <u:Badge Header="Hello" Dot="True" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<u:Badge Header="5" CornerPosition="TopLeft"> <u:Badge Header="5" CornerPosition="TopLeft">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="5" CornerPosition="TopRight"> <u:Badge Header="5" CornerPosition="TopRight">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="5" CornerPosition="BottomLeft"> <u:Badge Header="5" CornerPosition="BottomLeft">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="5" CornerPosition="BottomRight"> <u:Badge Header="5" CornerPosition="BottomRight">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@@ -56,88 +72,134 @@
Header="VIP" Header="VIP"
CornerPosition="TopLeft" CornerPosition="TopLeft"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="VIP" Header="VIP"
CornerPosition="TopRight" CornerPosition="TopRight"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="VIP" Header="VIP"
CornerPosition="BottomLeft" CornerPosition="BottomLeft"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="VIP" Header="VIP"
CornerPosition="BottomRight" CornerPosition="BottomRight"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
</StackPanel> </StackPanel>
<u:Badge HorizontalAlignment="Stretch" Header="VIP"> <u:Badge HorizontalAlignment="Stretch" Header="VIP">
<Border Height="50" /> <Border Height="50">
<TextBlock Text="■■■"/>
</Border>
</u:Badge> </u:Badge>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<u:Badge Header="URSA" Classes="Primary"> <u:Badge Header="URSA" Classes="Primary">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="URSA" Classes="Secondary"> <u:Badge Header="URSA" Classes="Secondary">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="URSA" Classes="Tertiary"> <u:Badge Header="URSA" Classes="Tertiary">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
</u:Badge> <TextBlock Text="Solid"/>
<u:Badge Header="URSA" Classes="Warning"> </Border>
<Border Width="100" Height="50" />
</u:Badge>
<u:Badge Header="URSA" Classes="Danger">
<Border Width="100" Height="50" />
</u:Badge> </u:Badge>
<u:Badge Header="URSA" Classes="Success"> <u:Badge Header="URSA" Classes="Success">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge>
<u:Badge Header="URSA" Classes="Warning">
<Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge>
<u:Badge Header="URSA" Classes="Danger">
<Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge> </u:Badge>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<u:Badge Header="URSA" Classes="Light Primary"> <u:Badge Header="URSA" Classes="Light Primary">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="URSA" Classes="Light Secondary"> <u:Badge Header="URSA" Classes="Light Secondary">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="URSA" Classes="Light Tertiary"> <u:Badge Header="URSA" Classes="Light Tertiary">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
</u:Badge> <TextBlock Text="Light"/>
<u:Badge Header="URSA" Classes="Light Warning"> </Border>
<Border Width="100" Height="50" />
</u:Badge>
<u:Badge Header="URSA" Classes="Light Danger">
<Border Width="100" Height="50" />
</u:Badge> </u:Badge>
<u:Badge Header="URSA" Classes="Light Success"> <u:Badge Header="URSA" Classes="Light Success">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge>
<u:Badge Header="URSA" Classes="Light Warning">
<Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge>
<u:Badge Header="URSA" Classes="Light Danger">
<Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge> </u:Badge>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<u:Badge Header="URSA" Classes="Inverted Primary"> <u:Badge Header="URSA" Classes="Inverted Primary">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="URSA" Classes="Inverted Secondary"> <u:Badge Header="URSA" Classes="Inverted Secondary">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge Header="URSA" Classes="Inverted Tertiary"> <u:Badge Header="URSA" Classes="Inverted Tertiary">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
</u:Badge> <TextBlock Text="Inverted"/>
<u:Badge Header="URSA" Classes="Inverted Warning"> </Border>
<Border Width="100" Height="50" />
</u:Badge>
<u:Badge Header="URSA" Classes="Inverted Danger">
<Border Width="100" Height="50" />
</u:Badge> </u:Badge>
<u:Badge Header="URSA" Classes="Inverted Success"> <u:Badge Header="URSA" Classes="Inverted Success">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge>
<u:Badge Header="URSA" Classes="Inverted Warning">
<Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge>
<u:Badge Header="URSA" Classes="Inverted Danger">
<Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge> </u:Badge>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@@ -145,37 +207,49 @@
Header="URSA" Header="URSA"
Classes="Primary" Classes="Primary"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Secondary" Classes="Secondary"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Tertiary" Classes="Tertiary"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
</u:Badge> <TextBlock Text="Solid"/>
<u:Badge </Border>
Header="URSA"
Classes="Warning"
Dot="True">
<Border Width="100" Height="50" />
</u:Badge>
<u:Badge
Header="URSA"
Classes="Danger"
Dot="True">
<Border Width="100" Height="50" />
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Success" Classes="Success"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge>
<u:Badge
Header="URSA"
Classes="Warning"
Dot="True">
<Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge>
<u:Badge
Header="URSA"
Classes="Danger"
Dot="True">
<Border Width="100" Height="50">
<TextBlock Text="Solid"/>
</Border>
</u:Badge> </u:Badge>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@@ -183,76 +257,100 @@
Header="URSA" Header="URSA"
Classes="Light Primary" Classes="Light Primary"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Light Secondary" Classes="Light Secondary"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Light Tertiary" Classes="Light Tertiary"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
</u:Badge> <TextBlock Text="Light"/>
<u:Badge </Border>
Header="URSA"
Classes="Light Warning"
Dot="True">
<Border Width="100" Height="50" />
</u:Badge>
<u:Badge
Header="URSA"
Classes="Light Danger"
Dot="True">
<Border Width="100" Height="50" />
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Light Success" Classes="Light Success"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge>
<u:Badge
Header="URSA"
Classes="Light Warning"
Dot="True">
<Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge>
<u:Badge
Header="URSA"
Classes="Light Danger"
Dot="True">
<Border Width="100" Height="50">
<TextBlock Text="Light"/>
</Border>
</u:Badge> </u:Badge>
</StackPanel> </StackPanel>
<Border Background="LightGray" CornerRadius="4"> <Border Background="{DynamicResource SemiGrey2}" CornerRadius="4">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Inverted Primary" Classes="Inverted Primary"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
</u:Badge> <TextBlock Text="Inverted"/>
<u:Badge </Border>
Header="URSA"
Classes="Inverted Primary"
Dot="True">
<Border Width="100" Height="50" />
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Inverted Secondary" Classes="Inverted Secondary"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Inverted Tertiary" Classes="Inverted Tertiary"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge>
<u:Badge
Header="URSA"
Classes="Inverted Success"
Dot="True">
<Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Inverted Warning" Classes="Inverted Warning"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge> </u:Badge>
<u:Badge <u:Badge
Header="URSA" Header="URSA"
Classes="Inverted Danger" Classes="Inverted Danger"
Dot="True"> Dot="True">
<Border Width="100" Height="50" /> <Border Width="100" Height="50">
<TextBlock Text="Inverted"/>
</Border>
</u:Badge> </u:Badge>
</StackPanel> </StackPanel>
</Border> </Border>

View File

@@ -32,7 +32,8 @@
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" /> ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{DynamicResource BadgeContentForeground}" />
<Border <Border
Name="{x:Static u:Badge.PART_BadgeContainer}" Name="{x:Static u:Badge.PART_BadgeContainer}"
MinWidth="{DynamicResource BadgeMinWidth}" MinWidth="{DynamicResource BadgeMinWidth}"
@@ -81,7 +82,8 @@
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" /> ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{DynamicResource BadgeContentForeground}" />
<Border <Border
Name="{x:Static u:Badge.PART_BadgeContainer}" Name="{x:Static u:Badge.PART_BadgeContainer}"
Width="{DynamicResource BadgeDotWidth}" Width="{DynamicResource BadgeDotWidth}"
@@ -100,86 +102,112 @@
</Style> </Style>
<Style Selector="^[CornerPosition=TopLeft] /template/ Border#PART_BadgeContainer"> <Style Selector="^[CornerPosition=TopLeft] /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.HorizontalAlignment" Value="Left" /> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="u:Badge.VerticalAlignment" Value="Top" /> <Setter Property="VerticalAlignment" Value="Top" />
</Style> </Style>
<Style Selector="^[CornerPosition=TopRight] /template/ Border#PART_BadgeContainer"> <Style Selector="^[CornerPosition=TopRight] /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.HorizontalAlignment" Value="Right" /> <Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="u:Badge.VerticalAlignment" Value="Top" /> <Setter Property="VerticalAlignment" Value="Top" />
</Style> </Style>
<Style Selector="^[CornerPosition=BottomLeft] /template/ Border#PART_BadgeContainer"> <Style Selector="^[CornerPosition=BottomLeft] /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.HorizontalAlignment" Value="Left" /> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="u:Badge.VerticalAlignment" Value="Bottom" /> <Setter Property="VerticalAlignment" Value="Bottom" />
</Style> </Style>
<Style Selector="^[CornerPosition=BottomRight] /template/ Border#PART_BadgeContainer"> <Style Selector="^[CornerPosition=BottomRight] /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.HorizontalAlignment" Value="Right" /> <Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="u:Badge.VerticalAlignment" Value="Bottom" /> <Setter Property="VerticalAlignment" Value="Bottom" />
</Style> </Style>
<Style Selector="^.Primary"> <Style Selector="^.Primary /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgePrimaryBadgeBackground}" /> <Setter Property="Background" Value="{DynamicResource BadgePrimaryBadgeBackground}" />
</Style> </Style>
<Style Selector="^.Secondary"> <Style Selector="^.Secondary /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeSecondaryBadgeBackground}" /> <Setter Property="Background" Value="{DynamicResource BadgeSecondaryBadgeBackground}" />
</Style> </Style>
<Style Selector="^.Tertiary"> <Style Selector="^.Tertiary /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeTertiaryBadgeBackground}" /> <Setter Property="Background" Value="{DynamicResource BadgeTertiaryBadgeBackground}" />
</Style> </Style>
<Style Selector="^.Warning"> <Style Selector="^.Success /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeWarningBadgeBackground}" /> <Setter Property="Background" Value="{DynamicResource BadgeSuccessBadgeBackground}" />
</Style> </Style>
<Style Selector="^.Danger"> <Style Selector="^.Warning /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeDangerBadgeBackground}" /> <Setter Property="Background" Value="{DynamicResource BadgeWarningBadgeBackground}" />
</Style> </Style>
<Style Selector="^.Success"> <Style Selector="^.Danger /template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeSuccessBadgeBackground}" /> <Setter Property="Background" Value="{DynamicResource BadgeDangerBadgeBackground}" />
</Style> </Style>
<Style Selector="^.Light"> <Style Selector="^.Light">
<Style Selector="^.Primary"> <Style Selector="^.Primary">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightPrimaryBadgeForeground}" /> <Style Selector="^/template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightPrimaryBadgeBackground}" /> <Setter Property="Foreground" Value="{DynamicResource BadgeLightPrimaryBadgeForeground}" />
</Style>
<Style Selector="^/template/ Border#PART_BadgeContainer">
<Setter Property="Background" Value="{DynamicResource BadgeLightPrimaryBadgeBackground}" />
</Style>
</Style> </Style>
<Style Selector="^.Secondary"> <Style Selector="^.Secondary">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightSecondaryBadgeForeground}" /> <Style Selector="^/template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightSecondaryBadgeBackground}" /> <Setter Property="Foreground" Value="{DynamicResource BadgeLightSecondaryBadgeForeground}" />
</Style>
<Style Selector="^/template/ Border#PART_BadgeContainer">
<Setter Property="Background" Value="{DynamicResource BadgeLightSecondaryBadgeBackground}" />
</Style>
</Style> </Style>
<Style Selector="^.Tertiary"> <Style Selector="^.Tertiary">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightTertiaryBadgeForeground}" /> <Style Selector="^/template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightTertiaryBadgeBackground}" /> <Setter Property="Foreground" Value="{DynamicResource BadgeLightTertiaryBadgeForeground}" />
</Style> </Style>
<Style Selector="^.Warning"> <Style Selector="^/template/ Border#PART_BadgeContainer">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightWarningBadgeForeground}" /> <Setter Property="Background" Value="{DynamicResource BadgeLightTertiaryBadgeBackground}" />
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightWarningBadgeBackground}" /> </Style>
</Style>
<Style Selector="^.Danger">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightDangerBadgeForeground}" />
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightDangerBadgeBackground}" />
</Style> </Style>
<Style Selector="^.Success"> <Style Selector="^.Success">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeLightSuccessBadgeForeground}" /> <Style Selector="^/template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeLightSuccessBadgeBackground}" /> <Setter Property="Foreground" Value="{DynamicResource BadgeLightSuccessBadgeForeground}" />
</Style>
<Style Selector="^/template/ Border#PART_BadgeContainer">
<Setter Property="Background" Value="{DynamicResource BadgeLightSuccessBadgeBackground}" />
</Style>
</Style>
<Style Selector="^.Warning">
<Style Selector="^/template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource BadgeLightWarningBadgeForeground}" />
</Style>
<Style Selector="^/template/ Border#PART_BadgeContainer">
<Setter Property="Background" Value="{DynamicResource BadgeLightWarningBadgeBackground}" />
</Style>
</Style>
<Style Selector="^.Danger">
<Style Selector="^/template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource BadgeLightDangerBadgeForeground}" />
</Style>
<Style Selector="^/template/ Border#PART_BadgeContainer">
<Setter Property="Background" Value="{DynamicResource BadgeLightDangerBadgeBackground}" />
</Style>
</Style> </Style>
</Style> </Style>
<Style Selector="^.Inverted"> <Style Selector="^.Inverted">
<Setter Property="u:Badge.Background" Value="{DynamicResource BadgeInvertedBadgeBackground}" /> <Style Selector="^/template/ Border#PART_BadgeContainer">
<Style Selector="^.Primary"> <Setter Property="Background" Value="{DynamicResource BadgeInvertedBadgeBackground}" />
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedPrimaryBadgeForeground}" />
</Style> </Style>
<Style Selector="^.Secondary"> <Style Selector="^.Primary /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedSecondaryBadgeForeground}" /> <Setter Property="Foreground" Value="{DynamicResource BadgeInvertedPrimaryBadgeForeground}" />
</Style> </Style>
<Style Selector="^.Tertiary"> <Style Selector="^.Secondary /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedTertiaryBadgeForeground}" /> <Setter Property="Foreground" Value="{DynamicResource BadgeInvertedSecondaryBadgeForeground}" />
</Style> </Style>
<Style Selector="^.Warning"> <Style Selector="^.Tertiary /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedWarningBadgeForeground}" /> <Setter Property="Foreground" Value="{DynamicResource BadgeInvertedTertiaryBadgeForeground}" />
</Style> </Style>
<Style Selector="^.Danger"> <Style Selector="^.Success /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedDangerBadgeForeground}" /> <Setter Property="Foreground" Value="{DynamicResource BadgeInvertedSuccessBadgeForeground}" />
</Style> </Style>
<Style Selector="^.Success"> <Style Selector="^.Warning /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="u:Badge.Foreground" Value="{DynamicResource BadgeInvertedSuccessBadgeForeground}" /> <Setter Property="Foreground" Value="{DynamicResource BadgeInvertedWarningBadgeForeground}" />
</Style>
<Style Selector="^.Danger /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource BadgeInvertedDangerBadgeForeground}" />
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>

View File

@@ -1,13 +1,14 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="BadgeBorderBrush" Color="#1C1F23" /> <SolidColorBrush x:Key="BadgeBorderBrush" Color="#1C1F23" />
<SolidColorBrush x:Key="BadgeForeground" Color="#1C1F23" /> <SolidColorBrush x:Key="BadgeForeground" Color="#1C1F23" />
<SolidColorBrush x:Key="BadgeContentForeground" Color="White" />
<!-- Solid --> <!-- Solid -->
<SolidColorBrush x:Key="BadgePrimaryBadgeBackground" Color="#FF54A9FF" /> <SolidColorBrush x:Key="BadgePrimaryBadgeBackground" Color="#FF54A9FF" />
<SolidColorBrush x:Key="BadgeSecondaryBadgeBackground" Color="#FF40B4F3" /> <SolidColorBrush x:Key="BadgeSecondaryBadgeBackground" Color="#FF40B4F3" />
<SolidColorBrush x:Key="BadgeTertiaryBadgeBackground" Color="#FF888D92" /> <SolidColorBrush x:Key="BadgeTertiaryBadgeBackground" Color="#FF888D92" />
<SolidColorBrush x:Key="BadgeSuccessBadgeBackground" Color="#FF5DC264" />
<SolidColorBrush x:Key="BadgeWarningBadgeBackground" Color="#FFFFAE43" /> <SolidColorBrush x:Key="BadgeWarningBadgeBackground" Color="#FFFFAE43" />
<SolidColorBrush x:Key="BadgeDangerBadgeBackground" Color="#FFFC725A" /> <SolidColorBrush x:Key="BadgeDangerBadgeBackground" Color="#FFFC725A" />
<SolidColorBrush x:Key="BadgeSuccessBadgeBackground" Color="#FF5DC264" />
<!-- Light --> <!-- Light -->
<SolidColorBrush x:Key="BadgeLightPrimaryBadgeForeground" Color="#FF54A9FF" /> <SolidColorBrush x:Key="BadgeLightPrimaryBadgeForeground" Color="#FF54A9FF" />
<SolidColorBrush x:Key="BadgeLightPrimaryBadgeBackground" Color="#FF003D8F" /> <SolidColorBrush x:Key="BadgeLightPrimaryBadgeBackground" Color="#FF003D8F" />
@@ -15,19 +16,19 @@
<SolidColorBrush x:Key="BadgeLightSecondaryBadgeBackground" Color="#FF004B83" /> <SolidColorBrush x:Key="BadgeLightSecondaryBadgeBackground" Color="#FF004B83" />
<SolidColorBrush x:Key="BadgeLightTertiaryBadgeForeground" Color="#FF888D92" /> <SolidColorBrush x:Key="BadgeLightTertiaryBadgeForeground" Color="#FF888D92" />
<SolidColorBrush x:Key="BadgeLightTertiaryBadgeBackground" Color="#FF2E3238" /> <SolidColorBrush x:Key="BadgeLightTertiaryBadgeBackground" Color="#FF2E3238" />
<SolidColorBrush x:Key="BadgeLightSuccessBadgeForeground" Color="#FF5DC264" />
<SolidColorBrush x:Key="BadgeLightSuccessBadgeBackground" Color="#FF1B5924" />
<SolidColorBrush x:Key="BadgeLightWarningBadgeForeground" Color="#FFFFAE43" /> <SolidColorBrush x:Key="BadgeLightWarningBadgeForeground" Color="#FFFFAE43" />
<SolidColorBrush x:Key="BadgeLightWarningBadgeBackground" Color="#FF7E3100" /> <SolidColorBrush x:Key="BadgeLightWarningBadgeBackground" Color="#FF7E3100" />
<SolidColorBrush x:Key="BadgeLightDangerBadgeForeground" Color="#FFFC725A" /> <SolidColorBrush x:Key="BadgeLightDangerBadgeForeground" Color="#FFFC725A" />
<SolidColorBrush x:Key="BadgeLightDangerBadgeBackground" Color="#FF8E0805" /> <SolidColorBrush x:Key="BadgeLightDangerBadgeBackground" Color="#FF8E0805" />
<SolidColorBrush x:Key="BadgeLightSuccessBadgeForeground" Color="#FF5DC264" />
<SolidColorBrush x:Key="BadgeLightSuccessBadgeBackground" Color="#FF1B5924" />
<!-- Inverted --> <!-- Inverted -->
<SolidColorBrush x:Key="BadgeInvertedBadgeBackground" Color="#1C1F23" /> <SolidColorBrush x:Key="BadgeInvertedBadgeBackground" Color="#1C1F23" />
<SolidColorBrush x:Key="BadgeInvertedPrimaryBadgeForeground" Color="#FF54A9FF" /> <SolidColorBrush x:Key="BadgeInvertedPrimaryBadgeForeground" Color="#FF54A9FF" />
<SolidColorBrush x:Key="BadgeInvertedSecondaryBadgeForeground" Color="#FF40B4F3" /> <SolidColorBrush x:Key="BadgeInvertedSecondaryBadgeForeground" Color="#FF40B4F3" />
<SolidColorBrush x:Key="BadgeInvertedTertiaryBadgeForeground" Color="#FF888D92" /> <SolidColorBrush x:Key="BadgeInvertedTertiaryBadgeForeground" Color="#FF888D92" />
<SolidColorBrush x:Key="BadgeInvertedSuccessBadgeForeground" Color="#FF5DC264" />
<SolidColorBrush x:Key="BadgeInvertedWarningBadgeForeground" Color="#FFFFAE43" /> <SolidColorBrush x:Key="BadgeInvertedWarningBadgeForeground" Color="#FFFFAE43" />
<SolidColorBrush x:Key="BadgeInvertedDangerBadgeForeground" Color="#FFFC725A" /> <SolidColorBrush x:Key="BadgeInvertedDangerBadgeForeground" Color="#FFFC725A" />
<SolidColorBrush x:Key="BadgeInvertedSuccessBadgeForeground" Color="#FF5DC264" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="BadgeBorderBrush" Color="White"/> <SolidColorBrush x:Key="BadgeBorderBrush" Color="White"/>
<SolidColorBrush x:Key="BadgeForeground" Color="White" /> <SolidColorBrush x:Key="BadgeForeground" Color="White" />
<SolidColorBrush x:Key="BadgeContentForeground" Color="#1C1F23" />
<!-- Solid --> <!-- Solid -->
<SolidColorBrush x:Key="BadgePrimaryBadgeBackground" Color="#0077F0" /> <SolidColorBrush x:Key="BadgePrimaryBadgeBackground" Color="#0077F0" />
<SolidColorBrush x:Key="BadgeSecondaryBadgeBackground" Color="#0095EE" /> <SolidColorBrush x:Key="BadgeSecondaryBadgeBackground" Color="#0095EE" />