@@ -6,6 +6,7 @@ public static class MenuKeys
|
||||
public const string MenuKeyBanner = "Banner";
|
||||
public const string MenuKeyButtonGroup = "ButtonGroup";
|
||||
public const string MenuKeyDivider = "Divider";
|
||||
public const string MenuKeyDualBadge = "DualBadge";
|
||||
public const string MenuKeyIpBox = "IPv4Box";
|
||||
public const string MenuKeyLoading = "Loading";
|
||||
public const string MenuKeyNavigation = "Navigation";
|
||||
|
||||
210
demo/Ursa.Demo/Pages/DualBadgeDemo.axaml
Normal file
210
demo/Ursa.Demo/Pages/DualBadgeDemo.axaml
Normal file
@@ -0,0 +1,210 @@
|
||||
<UserControl
|
||||
x:Class="Ursa.Demo.Pages.DualBadgeDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<PathGeometry x:Key="InfoPath">M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM14 7C14 8.10457 13.1046 9 12 9C10.8954 9 10 8.10457 10 7C10 5.89543 10.8954 5 12 5C13.1046 5 14 5.89543 14 7ZM9 10.75C9 10.3358 9.33579 10 9.75 10H12.5C13.0523 10 13.5 10.4477 13.5 11V16.5H14.25C14.6642 16.5 15 16.8358 15 17.25C15 17.6642 14.6642 18 14.25 18H9.75C9.33579 18 9 17.6642 9 17.25C9 16.8358 9.33579 16.5 9.75 16.5H10.5V11.5H9.75C9.33579 11.5 9 11.1642 9 10.75Z</PathGeometry>
|
||||
</UserControl.Resources>
|
||||
|
||||
<UserControl.Styles>
|
||||
<Style Selector="u|DualBadge">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<TextBlock Text="Flat:" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<u:DualBadge>
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
<u:DualBadge>
|
||||
<u:DualBadge.Icon>
|
||||
<PathIcon
|
||||
Width="14"
|
||||
Height="14"
|
||||
Data="{StaticResource InfoPath}" />
|
||||
</u:DualBadge.Icon>
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Header="downloads">
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Header="downloads">
|
||||
<u:DualBadge.Icon>
|
||||
<PathIcon
|
||||
Width="14"
|
||||
Height="14"
|
||||
Data="{StaticResource InfoPath}" />
|
||||
</u:DualBadge.Icon>
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="FlatSquare:" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<u:DualBadge Classes="FlatSquare">
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare">
|
||||
<u:DualBadge.Icon>
|
||||
<PathIcon
|
||||
Width="14"
|
||||
Height="14"
|
||||
Data="{StaticResource InfoPath}" />
|
||||
</u:DualBadge.Icon>
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare" Header="downloads">
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare" Header="downloads">
|
||||
<u:DualBadge.Icon>
|
||||
<PathIcon
|
||||
Width="14"
|
||||
Height="14"
|
||||
Data="{StaticResource InfoPath}" />
|
||||
</u:DualBadge.Icon>
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="Plastic:" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<u:DualBadge Classes="Plastic">
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic">
|
||||
<u:DualBadge.Icon>
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{StaticResource InfoPath}" />
|
||||
</u:DualBadge.Icon>
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic" Header="downloads">
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic" Header="downloads">
|
||||
<u:DualBadge.Icon>
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{StaticResource InfoPath}" />
|
||||
</u:DualBadge.Icon>
|
||||
2.4k
|
||||
</u:DualBadge>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="ForTheBadge:" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<u:DualBadge Classes="ForTheBadge">
|
||||
2.4K
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge">
|
||||
<u:DualBadge.Icon>
|
||||
<PathIcon
|
||||
Width="14"
|
||||
Height="14"
|
||||
Data="{StaticResource InfoPath}" />
|
||||
</u:DualBadge.Icon>
|
||||
2.4K
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge" Header="DOWNLOADS">
|
||||
2.4K
|
||||
</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge" Header="DOWNLOADS">
|
||||
<u:DualBadge.Icon>
|
||||
<PathIcon
|
||||
Width="14"
|
||||
Height="14"
|
||||
Data="{StaticResource InfoPath}" />
|
||||
</u:DualBadge.Icon>
|
||||
2.4K
|
||||
</u:DualBadge>
|
||||
</StackPanel>
|
||||
|
||||
<WrapPanel>
|
||||
<u:DualBadge Classes="Red">Red</u:DualBadge>
|
||||
<u:DualBadge Classes="Pink">Pink</u:DualBadge>
|
||||
<u:DualBadge Classes="Purple">Purple</u:DualBadge>
|
||||
<u:DualBadge Classes="Violet">Violet</u:DualBadge>
|
||||
<u:DualBadge Classes="Indigo">Indigo</u:DualBadge>
|
||||
<u:DualBadge Classes="Blue">Blue</u:DualBadge>
|
||||
<u:DualBadge Classes="LightBlue">LightBlue</u:DualBadge>
|
||||
<u:DualBadge Classes="Cyan">Cyan</u:DualBadge>
|
||||
<u:DualBadge Classes="Teal">Teal</u:DualBadge>
|
||||
<u:DualBadge Classes="Green">Green</u:DualBadge>
|
||||
<u:DualBadge Classes="LightGreen">LightGreen</u:DualBadge>
|
||||
<u:DualBadge Classes="Lime">Lime</u:DualBadge>
|
||||
<u:DualBadge Classes="Yellow">Yellow</u:DualBadge>
|
||||
<u:DualBadge Classes="Amber">Amber</u:DualBadge>
|
||||
<u:DualBadge Classes="Orange">Orange</u:DualBadge>
|
||||
<u:DualBadge Classes="Grey">Grey</u:DualBadge>
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<u:DualBadge Classes="FlatSquare Red">Red</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Pink">Pink</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Purple">Purple</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Violet">Violet</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Indigo">Indigo</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Blue">Blue</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare LightBlue">LightBlue</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Cyan">Cyan</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Teal">Teal</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Green">Green</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare LightGreen">LightGreen</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Lime">Lime</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Yellow">Yellow</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Amber">Amber</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Orange">Orange</u:DualBadge>
|
||||
<u:DualBadge Classes="FlatSquare Grey">Grey</u:DualBadge>
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<u:DualBadge Classes="Plastic Red">Red</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Pink">Pink</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Purple">Purple</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Violet">Violet</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Indigo">Indigo</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Blue">Blue</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic LightBlue">LightBlue</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Cyan">Cyan</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Teal">Teal</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Green">Green</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic LightGreen">LightGreen</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Lime">Lime</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Yellow">Yellow</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Amber">Amber</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Orange">Orange</u:DualBadge>
|
||||
<u:DualBadge Classes="Plastic Grey">Grey</u:DualBadge>
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<u:DualBadge Classes="ForTheBadge Red">Red</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Pink">Pink</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Purple">Purple</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Violet">Violet</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Indigo">Indigo</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Blue">Blue</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge LightBlue">LightBlue</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Cyan">Cyan</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Teal">Teal</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Green">Green</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge LightGreen">LightGreen</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Lime">Lime</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Yellow">Yellow</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Amber">Amber</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Orange">Orange</u:DualBadge>
|
||||
<u:DualBadge Classes="ForTheBadge Grey">Grey</u:DualBadge>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
11
demo/Ursa.Demo/Pages/DualBadgeDemo.axaml.cs
Normal file
11
demo/Ursa.Demo/Pages/DualBadgeDemo.axaml.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Ursa.Demo.Pages;
|
||||
|
||||
public partial class DualBadgeDemo : UserControl
|
||||
{
|
||||
public DualBadgeDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
5
demo/Ursa.Demo/ViewModels/DualBadgeDemoViewModel.cs
Normal file
5
demo/Ursa.Demo/ViewModels/DualBadgeDemoViewModel.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public class DualBadgeDemoViewModel : ViewModelBase
|
||||
{
|
||||
}
|
||||
@@ -28,6 +28,7 @@ public class MainViewViewModel : ViewModelBase
|
||||
MenuKeys.MenuKeyBanner => new BannerDemoViewModel(),
|
||||
MenuKeys.MenuKeyButtonGroup => new ButtonGroupDemoViewModel(),
|
||||
MenuKeys.MenuKeyDivider => new DividerDemoViewModel(),
|
||||
MenuKeys.MenuKeyDualBadge => new DualBadgeDemoViewModel(),
|
||||
MenuKeys.MenuKeyIpBox => new IPv4BoxDemoViewModel(),
|
||||
MenuKeys.MenuKeyLoading => new LoadingDemoViewModel(),
|
||||
MenuKeys.MenuKeyNavigation => new NavigationMenuDemoViewModel(),
|
||||
|
||||
@@ -15,6 +15,7 @@ public class MenuViewModel: ViewModelBase
|
||||
new() { MenuHeader = "Banner", Key = MenuKeys.MenuKeyBanner },
|
||||
new() { MenuHeader = "ButtonGroup", Key = MenuKeys.MenuKeyButtonGroup },
|
||||
new() { MenuHeader = "Divider", Key = MenuKeys.MenuKeyDivider },
|
||||
new() { MenuHeader = "DualBadge", Key = MenuKeys.MenuKeyDualBadge },
|
||||
new() { MenuHeader = "IPv4Box", Key = MenuKeys.MenuKeyIpBox },
|
||||
new() { MenuHeader = "Loading", Key = MenuKeys.MenuKeyLoading },
|
||||
new() { MenuHeader = "Navigation", Key = MenuKeys.MenuKeyNavigation },
|
||||
|
||||
177
src/Ursa.Themes.Semi/Controls/DualBadge.axaml
Normal file
177
src/Ursa.Themes.Semi/Controls/DualBadge.axaml
Normal file
@@ -0,0 +1,177 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:converters="clr-namespace:Ursa.Converters;assembly=Ursa">
|
||||
<ControlTheme x:Key="{x:Type u:DualBadge}" TargetType="u:DualBadge">
|
||||
<Setter Property="u:DualBadge.CornerRadius" Value="{DynamicResource DualBadgeDefaultCornerRadius}" />
|
||||
<Setter Property="u:DualBadge.FontSize" Value="{DynamicResource DualBadgeDefaultFontSize}" />
|
||||
<Setter Property="u:DualBadge.IconForeground" Value="{DynamicResource DualBadgeDefaultIconForeground}" />
|
||||
<Setter Property="u:DualBadge.HeaderForeground" Value="{DynamicResource DualBadgeDefaultHeaderForeground}" />
|
||||
<Setter Property="u:DualBadge.HeaderBackground" Value="{DynamicResource DualBadgeDefaultHeaderBackground}" />
|
||||
<Setter Property="u:DualBadge.Foreground" Value="{DynamicResource DualBadgeDefaultForeground}" />
|
||||
<Setter Property="u:DualBadge.Background" Value="{DynamicResource DualBadgeFlatGreenBackground}" />
|
||||
<Setter Property="u:DualBadge.ClipToBounds" Value="{DynamicResource DualBadgeDefaultClipToBounds}" />
|
||||
<Setter Property="u:DualBadge.HorizontalAlignment" Value="{DynamicResource DualBadgeDefaultHorizontalAlignment}" />
|
||||
<Setter Property="u:DualBadge.VerticalAlignment" Value="{DynamicResource DualBadgeDefaultVerticalAlignment}" />
|
||||
<Setter Property="u:DualBadge.UseLayoutRounding" Value="{DynamicResource DualBadgeDefaultUseLayoutRounding}" />
|
||||
<Setter Property="u:DualBadge.Padding" Value="{DynamicResource DualBadgeDefaultPadding}" />
|
||||
<Setter Property="u:DualBadge.Template">
|
||||
<ControlTemplate TargetType="{x:Type u:DualBadge}">
|
||||
<Border
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid ColumnDefinitions="Auto,Auto">
|
||||
<DockPanel
|
||||
Grid.Column="0"
|
||||
Background="{TemplateBinding HeaderBackground}">
|
||||
<ContentPresenter
|
||||
Name="{x:Static u:DualBadge.PART_Icon}"
|
||||
Width="{DynamicResource DualBadgeIconWidth}"
|
||||
Height="{DynamicResource DualBadgeIconHeight}"
|
||||
IsVisible="{TemplateBinding Icon,Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Foreground="{TemplateBinding IconForeground}"
|
||||
Margin="{TemplateBinding Padding, Converter={x:Static converters:ThicknessExcludeConverter.Right}}"
|
||||
Content="{TemplateBinding Icon}"
|
||||
ContentTemplate="{TemplateBinding IconTemplate}" />
|
||||
<ContentPresenter
|
||||
Name="{x:Static u:DualBadge.PART_HeaderPresenter}"
|
||||
TextElement.FontSize="{TemplateBinding FontSize}"
|
||||
IsVisible="{TemplateBinding Header,Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Foreground="{TemplateBinding HeaderForeground}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}" />
|
||||
</DockPanel>
|
||||
<ContentPresenter
|
||||
Name="{x:Static u:DualBadge.PART_ContentPresenter}"
|
||||
Grid.Column="1"
|
||||
TextElement.FontSize="{TemplateBinding FontSize}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^.Red">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatRedBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Pink">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatPinkBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Purple">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatPurpleBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Violet">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatVioletBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Indigo">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatIndigoBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Blue">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatBlueBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.LightBlue">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatLightBlueBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Cyan">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatCyanBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Teal">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatTealBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Green">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatGreenBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.LightGreen">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatLightGreenBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Lime">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatLimeBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Yellow">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatYellowBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Amber">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatAmberBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Orange">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatOrangeBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Grey">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgeFlatGreyBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.FlatSquare">
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource DualBadgeFlatSquareCornerRadius}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Plastic">
|
||||
<Setter Property="Padding" Value="{DynamicResource DualBadgePlasticPadding}" />
|
||||
<Setter Property="HeaderBackground" Value="{DynamicResource DualBadgePlasticHeaderBackground}" />
|
||||
<Style Selector="^.Red">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticRedBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Pink">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticPinkBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Purple">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticPurpleBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Violet">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticVioletBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Indigo">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticIndigoBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Blue">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticBlueBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.LightBlue">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticLightBlueBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Cyan">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticCyanBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Teal">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticTealBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Green">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticGreenBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.LightGreen">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticLightGreenBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Lime">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticLimeBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Yellow">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticYellowBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Amber">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticAmberBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Orange">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticOrangeBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Grey">
|
||||
<Setter Property="Background" Value="{DynamicResource DualBadgePlasticGreyBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.ForTheBadge">
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource DualBadgeForTheBadgeCornerRadius}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource DualBadgeForTheBadgePadding}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:header-empty">
|
||||
<Setter Property="HeaderBackground" Value="{Binding Background, RelativeSource={RelativeSource Self}}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -5,6 +5,7 @@
|
||||
<ResourceInclude Source="Banner.axaml" />
|
||||
<ResourceInclude Source="ButtonGroup.axaml" />
|
||||
<ResourceInclude Source="Divider.axaml" />
|
||||
<ResourceInclude Source="DualBadge.axaml" />
|
||||
<ResourceInclude Source="IPv4Box.axaml" />
|
||||
<ResourceInclude Source="Loading.axaml" />
|
||||
<ResourceInclude Source="Navigation.axaml" />
|
||||
|
||||
145
src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml
Normal file
145
src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml
Normal file
@@ -0,0 +1,145 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SolidColorBrush x:Key="DualBadgeDefaultIconForeground">White</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="DualBadgeDefaultHeaderForeground">White</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="DualBadgeDefaultForeground">White</SolidColorBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeDefaultHeaderBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF555B61" Offset="0" />
|
||||
<GradientStop Color="#FF41464C" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatRedBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFA664C" Offset="0" />
|
||||
<GradientStop Color="#FFF93920" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatPinkBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFED487B" Offset="0" />
|
||||
<GradientStop Color="#FFE91E63" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatPurpleBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFB449C2" Offset="0" />
|
||||
<GradientStop Color="#FF9E28B3" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatVioletBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF885BD2" Offset="0" />
|
||||
<GradientStop Color="#FF6A3AC7" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatIndigoBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF5E6FC4" Offset="0" />
|
||||
<GradientStop Color="#FF3F51B5" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatBlueBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF3295FB" Offset="0" />
|
||||
<GradientStop Color="#FF0077FA" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatLightBlueBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF30ACF1" Offset="0" />
|
||||
<GradientStop Color="#FF0095EE" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatCyanBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF2CB8C5" Offset="0" />
|
||||
<GradientStop Color="#FF2CB8C5" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatTealBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF27C2B0" Offset="0" />
|
||||
<GradientStop Color="#FF00B3A1" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatGreenBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF5AC262" Offset="0" />
|
||||
<GradientStop Color="#FF3BB346" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatLightGreenBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF93C55B" Offset="0" />
|
||||
<GradientStop Color="#FF7BB63C" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatLimeBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFA7DA2C" Offset="0" />
|
||||
<GradientStop Color="#FF9BD100" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatYellowBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFBDA32" Offset="0" />
|
||||
<GradientStop Color="#FFFAC800" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatAmberBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFF3C641" Offset="0" />
|
||||
<GradientStop Color="#FFF0B114" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatOrangeBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFDA633" Offset="0" />
|
||||
<GradientStop Color="#FFFC8800" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatGreyBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF888D92" Offset="0" />
|
||||
<GradientStop Color="#FF6B7075" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticHeaderBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF555B61" Offset="0" />
|
||||
<GradientStop Color="#FF2E3238" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticRedBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFA664C" Offset="0" />
|
||||
<GradientStop Color="#FFD52515" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticPinkBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFED487B" Offset="0" />
|
||||
<GradientStop Color="#FFC51356" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticPurpleBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFB449C2" Offset="0" />
|
||||
<GradientStop Color="#FF871E9E" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticVioletBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF885BD2" Offset="0" />
|
||||
<GradientStop Color="#FF572FB3" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticIndigoBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF5E6FC4" Offset="0" />
|
||||
<GradientStop Color="#FF3342A1" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticBlueBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF3295FB" Offset="0" />
|
||||
<GradientStop Color="#FF0077FA" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticLightBlueBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF30ACF1" Offset="0" />
|
||||
<GradientStop Color="#FF007BCA" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticCyanBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF2CB8C5" Offset="0" />
|
||||
<GradientStop Color="#FF038698" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticTealBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF27C2B0" Offset="0" />
|
||||
<GradientStop Color="#FF009589" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticGreenBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF5AC262" Offset="0" />
|
||||
<GradientStop Color="#FF30953B" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticLightGreenBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF93C55B" Offset="0" />
|
||||
<GradientStop Color="#FF649830" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticLimeBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFA7DA2C" Offset="0" />
|
||||
<GradientStop Color="#FF7EAE00" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticYellowBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFBDA32" Offset="0" />
|
||||
<GradientStop Color="#FFD0AA00" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticAmberBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFF3C641" Offset="0" />
|
||||
<GradientStop Color="#FFC88A0F" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticOrangeBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFDA633" Offset="0" />
|
||||
<GradientStop Color="#FFD26700" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticGreyBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF888D92" Offset="0" />
|
||||
<GradientStop Color="#FF555B61" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</ResourceDictionary>
|
||||
@@ -5,6 +5,7 @@
|
||||
<MergeResourceInclude Source="Banner.axaml" />
|
||||
<MergeResourceInclude Source="ButtonGroup.axaml" />
|
||||
<MergeResourceInclude Source="Divider.axaml" />
|
||||
<MergeResourceInclude Source="DualBadge.axaml" />
|
||||
<MergeResourceInclude Source="IPv4Box.axaml" />
|
||||
<MergeResourceInclude Source="Loading.axaml" />
|
||||
<MergeResourceInclude Source="NavigationMenu.axaml" />
|
||||
|
||||
145
src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml
Normal file
145
src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml
Normal file
@@ -0,0 +1,145 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SolidColorBrush x:Key="DualBadgeDefaultIconForeground">White</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="DualBadgeDefaultHeaderForeground">White</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="DualBadgeDefaultForeground">White</SolidColorBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeDefaultHeaderBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF555B61" Offset="0" />
|
||||
<GradientStop Color="#FF41464C" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatRedBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFA664C" Offset="0" />
|
||||
<GradientStop Color="#FFF93920" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatPinkBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFED487B" Offset="0" />
|
||||
<GradientStop Color="#FFE91E63" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatPurpleBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFB449C2" Offset="0" />
|
||||
<GradientStop Color="#FF9E28B3" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatVioletBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF885BD2" Offset="0" />
|
||||
<GradientStop Color="#FF6A3AC7" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatIndigoBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF5E6FC4" Offset="0" />
|
||||
<GradientStop Color="#FF3F51B5" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatBlueBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF3295FB" Offset="0" />
|
||||
<GradientStop Color="#FF0077FA" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatLightBlueBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF30ACF1" Offset="0" />
|
||||
<GradientStop Color="#FF0095EE" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatCyanBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF2CB8C5" Offset="0" />
|
||||
<GradientStop Color="#FF2CB8C5" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatTealBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF27C2B0" Offset="0" />
|
||||
<GradientStop Color="#FF00B3A1" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatGreenBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF5AC262" Offset="0" />
|
||||
<GradientStop Color="#FF3BB346" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatLightGreenBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF93C55B" Offset="0" />
|
||||
<GradientStop Color="#FF7BB63C" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatLimeBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFA7DA2C" Offset="0" />
|
||||
<GradientStop Color="#FF9BD100" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatYellowBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFBDA32" Offset="0" />
|
||||
<GradientStop Color="#FFFAC800" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatAmberBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFF3C641" Offset="0" />
|
||||
<GradientStop Color="#FFF0B114" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatOrangeBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFDA633" Offset="0" />
|
||||
<GradientStop Color="#FFFC8800" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgeFlatGreyBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF888D92" Offset="0" />
|
||||
<GradientStop Color="#FF6B7075" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticHeaderBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF555B61" Offset="0" />
|
||||
<GradientStop Color="#FF2E3238" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticRedBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFA664C" Offset="0" />
|
||||
<GradientStop Color="#FFD52515" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticPinkBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFED487B" Offset="0" />
|
||||
<GradientStop Color="#FFC51356" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticPurpleBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFB449C2" Offset="0" />
|
||||
<GradientStop Color="#FF871E9E" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticVioletBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF885BD2" Offset="0" />
|
||||
<GradientStop Color="#FF572FB3" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticIndigoBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF5E6FC4" Offset="0" />
|
||||
<GradientStop Color="#FF3342A1" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticBlueBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF3295FB" Offset="0" />
|
||||
<GradientStop Color="#FF0077FA" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticLightBlueBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF30ACF1" Offset="0" />
|
||||
<GradientStop Color="#FF007BCA" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticCyanBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF2CB8C5" Offset="0" />
|
||||
<GradientStop Color="#FF038698" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticTealBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF27C2B0" Offset="0" />
|
||||
<GradientStop Color="#FF009589" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticGreenBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF5AC262" Offset="0" />
|
||||
<GradientStop Color="#FF30953B" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticLightGreenBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF93C55B" Offset="0" />
|
||||
<GradientStop Color="#FF649830" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticLimeBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFA7DA2C" Offset="0" />
|
||||
<GradientStop Color="#FF7EAE00" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticYellowBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFBDA32" Offset="0" />
|
||||
<GradientStop Color="#FFD0AA00" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticAmberBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFF3C641" Offset="0" />
|
||||
<GradientStop Color="#FFC88A0F" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticOrangeBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FFFDA633" Offset="0" />
|
||||
<GradientStop Color="#FFD26700" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="DualBadgePlasticGreyBackground" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#FF888D92" Offset="0" />
|
||||
<GradientStop Color="#FF555B61" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</ResourceDictionary>
|
||||
@@ -5,6 +5,7 @@
|
||||
<MergeResourceInclude Source="Banner.axaml" />
|
||||
<MergeResourceInclude Source="ButtonGroup.axaml" />
|
||||
<MergeResourceInclude Source="Divider.axaml" />
|
||||
<MergeResourceInclude Source="DualBadge.axaml" />
|
||||
<MergeResourceInclude Source="IPv4Box.axaml" />
|
||||
<MergeResourceInclude Source="Loading.axaml" />
|
||||
<MergeResourceInclude Source="NavigationMenu.axaml" />
|
||||
|
||||
19
src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml
Normal file
19
src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<CornerRadius x:Key="DualBadgeDefaultCornerRadius">4</CornerRadius>
|
||||
<x:Double x:Key="DualBadgeDefaultFontSize">12</x:Double>
|
||||
<Thickness x:Key="DualBadgeDefaultThickness">1</Thickness>
|
||||
<Thickness x:Key="DualBadgeDefaultPadding">4 2</Thickness>
|
||||
<HorizontalAlignment x:Key="DualBadgeDefaultHorizontalAlignment">Left</HorizontalAlignment>
|
||||
<VerticalAlignment x:Key="DualBadgeDefaultVerticalAlignment">Center</VerticalAlignment>
|
||||
<x:Boolean x:Key="DualBadgeDefaultClipToBounds">False</x:Boolean>
|
||||
<x:Boolean x:Key="DualBadgeDefaultUseLayoutRounding">False</x:Boolean>
|
||||
<x:Double x:Key="DualBadgeIconWidth">14</x:Double>
|
||||
<x:Double x:Key="DualBadgeIconHeight">14</x:Double>
|
||||
|
||||
<CornerRadius x:Key="DualBadgeFlatSquareCornerRadius">0</CornerRadius>
|
||||
<Thickness x:Key="DualBadgePlasticPadding">4 0</Thickness>
|
||||
|
||||
<CornerRadius x:Key="DualBadgeForTheBadgeCornerRadius">0</CornerRadius>
|
||||
<Thickness x:Key="DualBadgeForTheBadgePadding">12 6</Thickness>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -5,6 +5,7 @@
|
||||
<MergeResourceInclude Source="Banner.axaml" />
|
||||
<MergeResourceInclude Source="ButtonGroup.axaml" />
|
||||
<MergeResourceInclude Source="Divider.axaml" />
|
||||
<MergeResourceInclude Source="DualBadge.axaml" />
|
||||
<MergeResourceInclude Source="IPv4Box.axaml" />
|
||||
<MergeResourceInclude Source="NavigationMenu.axaml" />
|
||||
<MergeResourceInclude Source="Pagination.axaml" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="../Package.props"/>
|
||||
<Import Project="../Package.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
@@ -13,11 +13,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Ursa\Ursa.csproj"/>
|
||||
<ProjectReference Include="..\Ursa\Ursa.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
96
src/Ursa/Controls/DualBadge.cs
Normal file
96
src/Ursa/Controls/DualBadge.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Metadata;
|
||||
using Avalonia.Controls.Presenters;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Controls.Templates;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Ursa.Controls;
|
||||
|
||||
[PseudoClasses(PC_IconEmpty, PC_HeaderEmpty, PC_ContentEmpty)]
|
||||
[TemplatePart(PART_Icon, typeof(ContentPresenter))]
|
||||
public class DualBadge : HeaderedContentControl
|
||||
{
|
||||
public const string PC_IconEmpty = ":icon-empty";
|
||||
public const string PC_HeaderEmpty = ":header-empty";
|
||||
public const string PC_ContentEmpty = ":content-empty";
|
||||
public const string PART_HeaderPresenter = "PART_HeaderPresenter";
|
||||
public const string PART_ContentPresenter = "PART_ContentPresenter";
|
||||
public const string PART_Icon = "PART_Icon";
|
||||
|
||||
public static readonly StyledProperty<object?> IconProperty =
|
||||
AvaloniaProperty.Register<DualBadge, object?>(nameof(Icon));
|
||||
|
||||
public object? Icon
|
||||
{
|
||||
get => GetValue(IconProperty);
|
||||
set => SetValue(IconProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IDataTemplate?> IconTemplateProperty =
|
||||
AvaloniaProperty.Register<DualBadge, IDataTemplate?>(nameof(IconTemplate));
|
||||
|
||||
public IDataTemplate? IconTemplate
|
||||
{
|
||||
get => GetValue(IconTemplateProperty);
|
||||
set => SetValue(IconTemplateProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush?> IconForegroundProperty =
|
||||
AvaloniaProperty.Register<DualBadge, IBrush?>(nameof(IconForeground));
|
||||
|
||||
public IBrush? IconForeground
|
||||
{
|
||||
get => GetValue(IconForegroundProperty);
|
||||
set => SetValue(IconForegroundProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush?> HeaderForegroundProperty =
|
||||
AvaloniaProperty.Register<DualBadge, IBrush?>(nameof(HeaderForeground));
|
||||
|
||||
public IBrush? HeaderForeground
|
||||
{
|
||||
get => GetValue(HeaderForegroundProperty);
|
||||
set => SetValue(HeaderForegroundProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush?> HeaderBackgroundProperty =
|
||||
AvaloniaProperty.Register<DualBadge, IBrush?>(nameof(HeaderBackground));
|
||||
|
||||
public IBrush? HeaderBackground
|
||||
{
|
||||
get => GetValue(HeaderBackgroundProperty);
|
||||
set => SetValue(HeaderBackgroundProperty, value);
|
||||
}
|
||||
|
||||
static DualBadge()
|
||||
{
|
||||
IconProperty.Changed.AddClassHandler<DualBadge>((o, args) => o.OnIconChanged());
|
||||
HeaderProperty.Changed.AddClassHandler<DualBadge>((o, args) => o.OnHeaderChanged());
|
||||
ContentProperty.Changed.AddClassHandler<DualBadge>((o, args) => o.OnContentChanged());
|
||||
}
|
||||
|
||||
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
OnIconChanged();
|
||||
OnHeaderChanged();
|
||||
OnContentChanged();
|
||||
}
|
||||
|
||||
private void OnIconChanged()
|
||||
{
|
||||
PseudoClasses.Set(PC_IconEmpty, Icon is null);
|
||||
}
|
||||
|
||||
private void OnHeaderChanged()
|
||||
{
|
||||
PseudoClasses.Set(PC_HeaderEmpty, Header is null);
|
||||
}
|
||||
|
||||
private void OnContentChanged()
|
||||
{
|
||||
PseudoClasses.Set(PC_ContentEmpty, Content is null);
|
||||
}
|
||||
}
|
||||
90
src/Ursa/Converters/CornerRadiusConverter.cs
Normal file
90
src/Ursa/Converters/CornerRadiusConverter.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace Ursa.Converters;
|
||||
|
||||
[Flags]
|
||||
public enum CornerRadiusPosition
|
||||
{
|
||||
TopLeft = 1,
|
||||
TopRight = 2,
|
||||
BottomLeft = 4,
|
||||
BottomRight = 8,
|
||||
Top = 3,
|
||||
Left = 5,
|
||||
Right = 10,
|
||||
Bottom = 12,
|
||||
}
|
||||
|
||||
public class CornerRadiusIncludeConverter: IValueConverter
|
||||
{
|
||||
public static CornerRadiusIncludeConverter TopLeft { get; } = new( CornerRadiusPosition.TopLeft );
|
||||
public static CornerRadiusIncludeConverter TopRight { get; } = new( CornerRadiusPosition.TopRight );
|
||||
public static CornerRadiusIncludeConverter BottomLeft { get; } = new( CornerRadiusPosition.BottomLeft );
|
||||
public static CornerRadiusIncludeConverter BottomRight { get; } = new( CornerRadiusPosition.BottomRight );
|
||||
public static CornerRadiusIncludeConverter Top { get; } = new( CornerRadiusPosition.Top );
|
||||
public static CornerRadiusIncludeConverter Left { get; } = new( CornerRadiusPosition.Left );
|
||||
public static CornerRadiusIncludeConverter Right { get; } = new( CornerRadiusPosition.Right );
|
||||
public static CornerRadiusIncludeConverter Bottom { get; } = new( CornerRadiusPosition.Bottom );
|
||||
|
||||
private readonly CornerRadiusPosition _position;
|
||||
|
||||
public CornerRadiusIncludeConverter(CornerRadiusPosition position)
|
||||
{
|
||||
_position = position;
|
||||
}
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is CornerRadius r)
|
||||
{
|
||||
double topLeft = _position.HasFlag(CornerRadiusPosition.TopLeft) ? r.TopLeft : 0;
|
||||
double topRight = _position.HasFlag(CornerRadiusPosition.TopRight) ? r.TopRight : 0;
|
||||
double bottomLeft = _position.HasFlag(CornerRadiusPosition.BottomLeft) ? r.BottomLeft : 0;
|
||||
double bottomRight = _position.HasFlag(CornerRadiusPosition.BottomRight) ? r.BottomRight : 0;
|
||||
return new CornerRadius(topLeft, topRight, bottomRight, bottomLeft);
|
||||
}
|
||||
return AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class CornerRadiusExcludeConverter : IValueConverter
|
||||
{
|
||||
public static CornerRadiusExcludeConverter TopLeft { get; } = new( CornerRadiusPosition.TopLeft );
|
||||
public static CornerRadiusExcludeConverter TopRight { get; } = new( CornerRadiusPosition.TopRight );
|
||||
public static CornerRadiusExcludeConverter BottomLeft { get; } = new( CornerRadiusPosition.BottomLeft );
|
||||
public static CornerRadiusExcludeConverter BottomRight { get; } = new( CornerRadiusPosition.BottomRight );
|
||||
public static CornerRadiusExcludeConverter Top { get; } = new( CornerRadiusPosition.Top );
|
||||
public static CornerRadiusExcludeConverter Left { get; } = new( CornerRadiusPosition.Left );
|
||||
public static CornerRadiusExcludeConverter Right { get; } = new( CornerRadiusPosition.Right );
|
||||
public static CornerRadiusExcludeConverter Bottom { get; } = new( CornerRadiusPosition.Bottom );
|
||||
|
||||
private readonly CornerRadiusPosition _position;
|
||||
|
||||
public CornerRadiusExcludeConverter(CornerRadiusPosition position)
|
||||
{
|
||||
_position = position;
|
||||
}
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is CornerRadius r)
|
||||
{
|
||||
double topLeft = _position.HasFlag(CornerRadiusPosition.TopLeft) ? 0 : r.TopLeft;
|
||||
double topRight = _position.HasFlag(CornerRadiusPosition.TopRight) ? 0 : r.TopRight;
|
||||
double bottomLeft = _position.HasFlag(CornerRadiusPosition.BottomLeft) ? 0 : r.BottomLeft;
|
||||
double bottomRight = _position.HasFlag(CornerRadiusPosition.BottomRight) ? 0 : r.BottomRight;
|
||||
return new CornerRadius(topLeft, topRight, bottomRight, bottomLeft);
|
||||
}
|
||||
return AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
91
src/Ursa/Converters/ThicknessConverter.cs
Normal file
91
src/Ursa/Converters/ThicknessConverter.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace Ursa.Converters;
|
||||
|
||||
[Flags]
|
||||
public enum ThicknessPosition
|
||||
{
|
||||
Left = 1,
|
||||
Top = 2,
|
||||
Right = 4,
|
||||
Bottom = 8,
|
||||
TopLeft = 3,
|
||||
TopRight = 6,
|
||||
BottomLeft = 9,
|
||||
BottomRight = 12,
|
||||
}
|
||||
|
||||
public class ThicknessExcludeConverter: IValueConverter
|
||||
{
|
||||
public static ThicknessExcludeConverter Left { get; } = new( ThicknessPosition.Left );
|
||||
public static ThicknessExcludeConverter Top { get; } = new( ThicknessPosition.Top );
|
||||
public static ThicknessExcludeConverter Right { get; } = new( ThicknessPosition.Right );
|
||||
public static ThicknessExcludeConverter Bottom { get; } = new( ThicknessPosition.Bottom );
|
||||
public static ThicknessExcludeConverter TopLeft { get; } = new( ThicknessPosition.TopLeft );
|
||||
public static ThicknessExcludeConverter TopRight { get; } = new( ThicknessPosition.TopRight );
|
||||
public static ThicknessExcludeConverter BottomLeft { get; } = new( ThicknessPosition.BottomLeft );
|
||||
public static ThicknessExcludeConverter BottomRight { get; } = new( ThicknessPosition.BottomRight );
|
||||
|
||||
private readonly ThicknessPosition _position;
|
||||
public ThicknessExcludeConverter(ThicknessPosition position)
|
||||
{
|
||||
_position = position;
|
||||
}
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is Thickness t)
|
||||
{
|
||||
double left = _position.HasFlag(ThicknessPosition.Left) ? 0d: t.Left;
|
||||
double top = _position.HasFlag(ThicknessPosition.Top) ? 0d : t.Top;
|
||||
double right = _position.HasFlag(ThicknessPosition.Right) ? 0d : t.Right;
|
||||
double bottom = _position.HasFlag(ThicknessPosition.Bottom) ? 0d : t.Bottom;
|
||||
|
||||
return new Thickness(left, top, right, bottom);
|
||||
}
|
||||
return AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class ThicknessIncludeConverter: IValueConverter
|
||||
{
|
||||
public static ThicknessIncludeConverter Left { get; } = new( ThicknessPosition.Left );
|
||||
public static ThicknessIncludeConverter Top { get; } = new( ThicknessPosition.Top );
|
||||
public static ThicknessIncludeConverter Right { get; } = new( ThicknessPosition.Right );
|
||||
public static ThicknessIncludeConverter Bottom { get; } = new( ThicknessPosition.Bottom );
|
||||
public static ThicknessIncludeConverter TopLeft { get; } = new( ThicknessPosition.TopLeft );
|
||||
public static ThicknessIncludeConverter TopRight { get; } = new( ThicknessPosition.TopRight );
|
||||
public static ThicknessIncludeConverter BottomLeft { get; } = new( ThicknessPosition.BottomLeft );
|
||||
public static ThicknessIncludeConverter BottomRight { get; } = new( ThicknessPosition.BottomRight );
|
||||
|
||||
private readonly ThicknessPosition _position;
|
||||
public ThicknessIncludeConverter(ThicknessPosition position)
|
||||
{
|
||||
_position = position;
|
||||
}
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is Thickness t)
|
||||
{
|
||||
var left = _position.HasFlag(ThicknessPosition.Left) ? t.Left : 0d;
|
||||
var top = _position.HasFlag(ThicknessPosition.Top) ? t.Top : 0d;
|
||||
var right = _position.HasFlag(ThicknessPosition.Right) ? t.Right : 0d;
|
||||
var bottom = _position.HasFlag(ThicknessPosition.Bottom) ? t.Bottom : 0d;
|
||||
return new Thickness(left, top, right, bottom);
|
||||
}
|
||||
return AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="../Package.props"/>
|
||||
<Import Project="../Package.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
@@ -13,7 +13,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user