From 82312e747757b92fc28921a639648cd8b101ef42 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 26 Jul 2023 10:20:13 +0800 Subject: [PATCH 01/13] feat: initial DualBadge. --- demo/Ursa.Demo/Models/MenuKeys.cs | 1 + demo/Ursa.Demo/Pages/DualBadgeDemo.axaml | 23 ++++++++ demo/Ursa.Demo/Pages/DualBadgeDemo.axaml.cs | 11 ++++ .../ViewModels/DualBadgeDemoViewModel.cs | 5 ++ .../Ursa.Demo/ViewModels/MainViewViewModel.cs | 1 + demo/Ursa.Demo/ViewModels/MenuViewModel.cs | 1 + src/Ursa.Themes.Semi/Controls/DualBadge.axaml | 45 ++++++++++++++++ src/Ursa.Themes.Semi/Controls/_index.axaml | 1 + .../Themes/Dark/DualBadge.axaml | 3 ++ src/Ursa.Themes.Semi/Themes/Dark/_index.axaml | 1 + .../Themes/Light/DualBadge.axaml | 3 ++ .../Themes/Light/_index.axaml | 1 + .../Themes/Shared/DualBadge.axaml | 2 + .../Themes/Shared/_index.axaml | 1 + src/Ursa/Controls/DualBadge.cs | 53 +++++++++++++++++++ 15 files changed, 152 insertions(+) create mode 100644 demo/Ursa.Demo/Pages/DualBadgeDemo.axaml create mode 100644 demo/Ursa.Demo/Pages/DualBadgeDemo.axaml.cs create mode 100644 demo/Ursa.Demo/ViewModels/DualBadgeDemoViewModel.cs create mode 100644 src/Ursa.Themes.Semi/Controls/DualBadge.axaml create mode 100644 src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml create mode 100644 src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml create mode 100644 src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml create mode 100644 src/Ursa/Controls/DualBadge.cs diff --git a/demo/Ursa.Demo/Models/MenuKeys.cs b/demo/Ursa.Demo/Models/MenuKeys.cs index 5a76eb9..1d8954e 100644 --- a/demo/Ursa.Demo/Models/MenuKeys.cs +++ b/demo/Ursa.Demo/Models/MenuKeys.cs @@ -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"; diff --git a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml new file mode 100644 index 0000000..d0aea05 --- /dev/null +++ b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml @@ -0,0 +1,23 @@ + + + + + + + passing + + + \ No newline at end of file diff --git a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml.cs b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml.cs new file mode 100644 index 0000000..6db9c2f --- /dev/null +++ b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace Ursa.Demo.Pages; + +public partial class DualBadgeDemo : UserControl +{ + public DualBadgeDemo() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/demo/Ursa.Demo/ViewModels/DualBadgeDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/DualBadgeDemoViewModel.cs new file mode 100644 index 0000000..bc992fc --- /dev/null +++ b/demo/Ursa.Demo/ViewModels/DualBadgeDemoViewModel.cs @@ -0,0 +1,5 @@ +namespace Ursa.Demo.ViewModels; + +public class DualBadgeDemoViewModel : ViewModelBase +{ +} \ No newline at end of file diff --git a/demo/Ursa.Demo/ViewModels/MainViewViewModel.cs b/demo/Ursa.Demo/ViewModels/MainViewViewModel.cs index 6641f1f..54109ae 100644 --- a/demo/Ursa.Demo/ViewModels/MainViewViewModel.cs +++ b/demo/Ursa.Demo/ViewModels/MainViewViewModel.cs @@ -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(), diff --git a/demo/Ursa.Demo/ViewModels/MenuViewModel.cs b/demo/Ursa.Demo/ViewModels/MenuViewModel.cs index 9351ad9..011375b 100644 --- a/demo/Ursa.Demo/ViewModels/MenuViewModel.cs +++ b/demo/Ursa.Demo/ViewModels/MenuViewModel.cs @@ -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 }, diff --git a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml new file mode 100644 index 0000000..05ec0de --- /dev/null +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/_index.axaml b/src/Ursa.Themes.Semi/Controls/_index.axaml index bbf2752..dee9b3c 100644 --- a/src/Ursa.Themes.Semi/Controls/_index.axaml +++ b/src/Ursa.Themes.Semi/Controls/_index.axaml @@ -5,6 +5,7 @@ + diff --git a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml new file mode 100644 index 0000000..d57aae4 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml @@ -0,0 +1,3 @@ + + LightGray + diff --git a/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml b/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml index c9f2bea..aa85239 100644 --- a/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml +++ b/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml @@ -5,6 +5,7 @@ + diff --git a/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml new file mode 100644 index 0000000..d57aae4 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml @@ -0,0 +1,3 @@ + + LightGray + diff --git a/src/Ursa.Themes.Semi/Themes/Light/_index.axaml b/src/Ursa.Themes.Semi/Themes/Light/_index.axaml index c9f2bea..aa85239 100644 --- a/src/Ursa.Themes.Semi/Themes/Light/_index.axaml +++ b/src/Ursa.Themes.Semi/Themes/Light/_index.axaml @@ -5,6 +5,7 @@ + diff --git a/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml new file mode 100644 index 0000000..c9ef25a --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml @@ -0,0 +1,2 @@ + + diff --git a/src/Ursa.Themes.Semi/Themes/Shared/_index.axaml b/src/Ursa.Themes.Semi/Themes/Shared/_index.axaml index 777a0a4..7bf0b4d 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/_index.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/_index.axaml @@ -5,6 +5,7 @@ + diff --git a/src/Ursa/Controls/DualBadge.cs b/src/Ursa/Controls/DualBadge.cs new file mode 100644 index 0000000..94f9664 --- /dev/null +++ b/src/Ursa/Controls/DualBadge.cs @@ -0,0 +1,53 @@ +using Avalonia; +using Avalonia.Controls.Metadata; +using Avalonia.Controls.Presenters; +using Avalonia.Controls.Primitives; +using Avalonia.Controls.Templates; +using Avalonia.Media; + +namespace Ursa.Controls; + +[TemplatePart(PART_Icon, typeof(ContentPresenter))] +public class DualBadge : HeaderedContentControl +{ + 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 IconProperty = + AvaloniaProperty.Register(nameof(Icon)); + + public object? Icon + { + get => GetValue(IconProperty); + set => SetValue(IconProperty, value); + } + + public static readonly StyledProperty IconTemplateProperty = + AvaloniaProperty.Register(nameof(IconTemplate)); + + public IDataTemplate? IconTemplate + { + get => GetValue(IconTemplateProperty); + set => SetValue(IconTemplateProperty, value); + } + + + public static readonly StyledProperty HeaderForegroundProperty = + AvaloniaProperty.Register(nameof(HeaderForeground)); + + public IBrush? HeaderForeground + { + get => GetValue(HeaderForegroundProperty); + set => SetValue(HeaderForegroundProperty, value); + } + + public static readonly StyledProperty HeaderBackgroundProperty = + AvaloniaProperty.Register(nameof(HeaderBackground)); + + public IBrush? HeaderBackground + { + get => GetValue(HeaderBackgroundProperty); + set => SetValue(HeaderBackgroundProperty, value); + } +} \ No newline at end of file From 240c5a0490ed1d4f747c79c68ca9e6519c76a2b2 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 26 Jul 2023 23:46:34 +0800 Subject: [PATCH 02/13] feat: simple DualBadge. --- demo/Ursa.Demo/Pages/DualBadgeDemo.axaml | 72 +++++++++++++--- src/Ursa.Themes.Semi/Controls/DualBadge.axaml | 82 ++++++++++++++----- .../Themes/Dark/DualBadge.axaml | 4 +- .../Themes/Light/DualBadge.axaml | 4 +- .../Themes/Shared/DualBadge.axaml | 7 +- 5 files changed, 136 insertions(+), 33 deletions(-) diff --git a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml index d0aea05..453c5fe 100644 --- a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml +++ b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml @@ -8,16 +8,68 @@ d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d"> - - - - - - passing + + + 2.4k + + + + + + + + + + 2.4k + + + + + + + + + + 2.4k + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml index 05ec0de..23db8eb 100644 --- a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -2,44 +2,86 @@ xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:u="https://irihi.tech/ursa"> - + + + + + + - - + + - + - - + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + VerticalAlignment="{TemplateBinding VerticalAlignment}"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml index d57aae4..216f643 100644 --- a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml @@ -1,3 +1,5 @@  - LightGray + White + #FF5DC264 + #FF888D92 diff --git a/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml index d57aae4..36d7c6c 100644 --- a/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml @@ -1,3 +1,5 @@  - LightGray + White + #FF3BB346 + #FF6B7075 diff --git a/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml index c9ef25a..9d476b4 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml @@ -1,2 +1,7 @@  - + 4 0 0 4 + 0 4 4 0 + 12 + 1 + 4 2 + \ No newline at end of file From f429d8219c0185769ceb2d99d936c53a46fbf1ce Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Thu, 27 Jul 2023 00:35:05 +0800 Subject: [PATCH 03/13] feat: add Icon style. --- demo/Ursa.Demo/Pages/DualBadgeDemo.axaml | 54 +++---------- src/Ursa.Themes.Semi/Controls/DualBadge.axaml | 75 +++++++------------ .../Themes/Dark/DualBadge.axaml | 6 +- .../Themes/Light/DualBadge.axaml | 6 +- .../Themes/Shared/DualBadge.axaml | 2 +- src/Ursa/Controls/DualBadge.cs | 8 ++ 6 files changed, 54 insertions(+), 97 deletions(-) diff --git a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml index 453c5fe..fbb4738 100644 --- a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml +++ b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml @@ -14,13 +14,13 @@ - + - - + + 2.4k - - - - - - - + + + + 2.4k - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml index 23db8eb..fa9a31f 100644 --- a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -5,13 +5,15 @@ + + + - @@ -19,17 +21,31 @@ HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"> - + CornerRadius="{DynamicResource DualBadgeDefaultLeftCornerRadius}"> + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml index 216f643..f1f8875 100644 --- a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml @@ -1,5 +1,7 @@  + White + White + #FF888D92 White #FF5DC264 - #FF888D92 - + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml index 36d7c6c..a8ee239 100644 --- a/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml @@ -1,5 +1,7 @@  + White + White + #FF6B7075 White #FF3BB346 - #FF6B7075 - + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml index 9d476b4..ce2a09b 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml @@ -1,5 +1,5 @@  - 4 0 0 4 + 4 0 0 4 0 4 4 0 12 1 diff --git a/src/Ursa/Controls/DualBadge.cs b/src/Ursa/Controls/DualBadge.cs index 94f9664..de02345 100644 --- a/src/Ursa/Controls/DualBadge.cs +++ b/src/Ursa/Controls/DualBadge.cs @@ -32,6 +32,14 @@ public class DualBadge : HeaderedContentControl set => SetValue(IconTemplateProperty, value); } + public static readonly StyledProperty IconForegroundProperty = + AvaloniaProperty.Register(nameof(IconForeground)); + + public IBrush? IconForeground + { + get => GetValue(IconForegroundProperty); + set => SetValue(IconForegroundProperty, value); + } public static readonly StyledProperty HeaderForegroundProperty = AvaloniaProperty.Register(nameof(HeaderForeground)); From c5589b3db357db9a103e1c13158b9117532df55b Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:22:50 +0800 Subject: [PATCH 04/13] feat: DualBadge CornerRadius. --- src/Ursa.Themes.Semi/Controls/DualBadge.axaml | 54 ++++++++--------- .../Themes/Shared/DualBadge.axaml | 3 +- src/Ursa/Controls/DualBadge.cs | 58 +++++++++++++++++++ 3 files changed, 87 insertions(+), 28 deletions(-) diff --git a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml index fa9a31f..80b36f0 100644 --- a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -19,40 +19,38 @@ + VerticalAlignment="{TemplateBinding VerticalAlignment}" + ClipToBounds="True" + CornerRadius="{TemplateBinding CornerRadius}"> - - - - - - + Background="{TemplateBinding HeaderBackground}"> + + + @@ -60,5 +58,9 @@ + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml index ce2a09b..c08cf04 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/DualBadge.axaml @@ -1,6 +1,5 @@  - 4 0 0 4 - 0 4 4 0 + 4 12 1 4 2 diff --git a/src/Ursa/Controls/DualBadge.cs b/src/Ursa/Controls/DualBadge.cs index de02345..9e445c6 100644 --- a/src/Ursa/Controls/DualBadge.cs +++ b/src/Ursa/Controls/DualBadge.cs @@ -1,4 +1,5 @@ using Avalonia; +using Avalonia.Controls; using Avalonia.Controls.Metadata; using Avalonia.Controls.Presenters; using Avalonia.Controls.Primitives; @@ -7,9 +8,13 @@ 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"; @@ -58,4 +63,57 @@ public class DualBadge : HeaderedContentControl get => GetValue(HeaderBackgroundProperty); set => SetValue(HeaderBackgroundProperty, value); } + + public static readonly StyledProperty IsIconEmptyProperty = AvaloniaProperty.Register( + nameof(IsIconEmpty)); + + public bool IsIconEmpty + { + get => GetValue(IsIconEmptyProperty); + set => SetValue(IsIconEmptyProperty, value); + } + + public static readonly StyledProperty IsHeaderEmptyProperty = AvaloniaProperty.Register( + nameof(IsHeaderEmpty)); + + public bool IsHeaderEmpty + { + get => GetValue(IsHeaderEmptyProperty); + set => SetValue(IsHeaderEmptyProperty, value); + } + + public static readonly StyledProperty IsContentEmptyProperty = AvaloniaProperty.Register( + nameof(IsContentEmpty)); + + public bool IsContentEmpty + { + get => GetValue(IsContentEmptyProperty); + set => SetValue(IsContentEmptyProperty, value); + } + + + static DualBadge() + { + IsIconEmptyProperty.Changed.AddClassHandler((o, e) => o.OnIsIconEmptyChanged(e)); + IsHeaderEmptyProperty.Changed.AddClassHandler((o, e) => o.OnIsHeaderEmptyChanged(e)); + IsContentEmptyProperty.Changed.AddClassHandler((o, e) => o.OnIsContentEmptyChanged(e)); + } + + private void OnIsIconEmptyChanged(AvaloniaPropertyChangedEventArgs args) + { + bool newValue = args.GetNewValue(); + PseudoClasses.Set(PC_IconEmpty, newValue); + } + + private void OnIsHeaderEmptyChanged(AvaloniaPropertyChangedEventArgs args) + { + bool newValue = args.GetNewValue(); + PseudoClasses.Set(PC_HeaderEmpty, newValue); + } + + private void OnIsContentEmptyChanged(AvaloniaPropertyChangedEventArgs args) + { + bool newValue = args.GetNewValue(); + PseudoClasses.Set(PC_ContentEmpty, newValue); + } } \ No newline at end of file From 237d63d414a6eb5a2762ef1932559dd07c73dd78 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:57:55 +0800 Subject: [PATCH 05/13] feat: add pseudoclasses. --- src/Ursa.Themes.Semi/Controls/DualBadge.axaml | 8 +-- src/Ursa/Controls/DualBadge.cs | 58 ++++++------------- 2 files changed, 22 insertions(+), 44 deletions(-) diff --git a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml index 80b36f0..a8b10ba 100644 --- a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ VerticalAlignment="{TemplateBinding VerticalAlignment}" ClipToBounds="True" CornerRadius="{TemplateBinding CornerRadius}"> - + @@ -43,7 +43,7 @@ Foreground="{TemplateBinding HeaderForeground}" Padding="{TemplateBinding Padding}" Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}"/> + ContentTemplate="{TemplateBinding HeaderTemplate}" /> \ No newline at end of file diff --git a/src/Ursa/Controls/DualBadge.cs b/src/Ursa/Controls/DualBadge.cs index 9e445c6..de6df7c 100644 --- a/src/Ursa/Controls/DualBadge.cs +++ b/src/Ursa/Controls/DualBadge.cs @@ -4,6 +4,7 @@ using Avalonia.Controls.Metadata; using Avalonia.Controls.Presenters; using Avalonia.Controls.Primitives; using Avalonia.Controls.Templates; +using Avalonia.Interactivity; using Avalonia.Media; namespace Ursa.Controls; @@ -64,56 +65,33 @@ public class DualBadge : HeaderedContentControl set => SetValue(HeaderBackgroundProperty, value); } - public static readonly StyledProperty IsIconEmptyProperty = AvaloniaProperty.Register( - nameof(IsIconEmpty)); - - public bool IsIconEmpty - { - get => GetValue(IsIconEmptyProperty); - set => SetValue(IsIconEmptyProperty, value); - } - - public static readonly StyledProperty IsHeaderEmptyProperty = AvaloniaProperty.Register( - nameof(IsHeaderEmpty)); - - public bool IsHeaderEmpty - { - get => GetValue(IsHeaderEmptyProperty); - set => SetValue(IsHeaderEmptyProperty, value); - } - - public static readonly StyledProperty IsContentEmptyProperty = AvaloniaProperty.Register( - nameof(IsContentEmpty)); - - public bool IsContentEmpty - { - get => GetValue(IsContentEmptyProperty); - set => SetValue(IsContentEmptyProperty, value); - } - - static DualBadge() { - IsIconEmptyProperty.Changed.AddClassHandler((o, e) => o.OnIsIconEmptyChanged(e)); - IsHeaderEmptyProperty.Changed.AddClassHandler((o, e) => o.OnIsHeaderEmptyChanged(e)); - IsContentEmptyProperty.Changed.AddClassHandler((o, e) => o.OnIsContentEmptyChanged(e)); + IconProperty.Changed.AddClassHandler((o, args) => o.OnIconChanged()); + HeaderProperty.Changed.AddClassHandler((o, args) => o.OnHeaderChanged()); + ContentProperty.Changed.AddClassHandler((o, args) => o.OnContentChanged()); } - private void OnIsIconEmptyChanged(AvaloniaPropertyChangedEventArgs args) + protected override void OnLoaded(RoutedEventArgs e) { - bool newValue = args.GetNewValue(); - PseudoClasses.Set(PC_IconEmpty, newValue); + base.OnLoaded(e); + OnIconChanged(); + OnHeaderChanged(); + OnContentChanged(); } - private void OnIsHeaderEmptyChanged(AvaloniaPropertyChangedEventArgs args) + private void OnIconChanged() { - bool newValue = args.GetNewValue(); - PseudoClasses.Set(PC_HeaderEmpty, newValue); + PseudoClasses.Set(PC_IconEmpty, Icon is null); } - private void OnIsContentEmptyChanged(AvaloniaPropertyChangedEventArgs args) + private void OnHeaderChanged() { - bool newValue = args.GetNewValue(); - PseudoClasses.Set(PC_ContentEmpty, newValue); + PseudoClasses.Set(PC_HeaderEmpty, Header is null); + } + + private void OnContentChanged() + { + PseudoClasses.Set(PC_ContentEmpty, Content is null); } } \ No newline at end of file From 40fc7a04b1246ffa2e8b1a566550c7f4741fd91e Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Thu, 27 Jul 2023 23:48:58 +0800 Subject: [PATCH 06/13] feat: add Themes. --- demo/Ursa.Demo/Pages/DualBadgeDemo.axaml | 71 ++++++++++++++++++- src/Ursa.Themes.Semi/Controls/DualBadge.axaml | 24 +++++++ .../Themes/Dark/DualBadge.axaml | 9 ++- .../Themes/Light/DualBadge.axaml | 11 ++- src/Ursa/Controls/DualBadge.cs | 5 +- 5 files changed, 111 insertions(+), 9 deletions(-) diff --git a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml index fbb4738..c3fb94d 100644 --- a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml +++ b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml @@ -12,7 +12,7 @@ 2.4k - + 2.4k - + 2.4k - + @@ -39,5 +39,70 @@ 2.4k + + + + 2.4K + + + + + + + 2.4K + + + + 2.4K + + + + + + + 2.4K + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml index a8b10ba..4cfb62f 100644 --- a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -63,4 +63,28 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml index f1f8875..9bf6a64 100644 --- a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml @@ -3,5 +3,12 @@ White #FF888D92 White - #FF5DC264 + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml index a8ee239..6249aa8 100644 --- a/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml @@ -1,7 +1,14 @@  White White - #FF6B7075 + + + + White - #FF3BB346 + + + + + \ No newline at end of file diff --git a/src/Ursa/Controls/DualBadge.cs b/src/Ursa/Controls/DualBadge.cs index de6df7c..7ffd789 100644 --- a/src/Ursa/Controls/DualBadge.cs +++ b/src/Ursa/Controls/DualBadge.cs @@ -4,7 +4,6 @@ using Avalonia.Controls.Metadata; using Avalonia.Controls.Presenters; using Avalonia.Controls.Primitives; using Avalonia.Controls.Templates; -using Avalonia.Interactivity; using Avalonia.Media; namespace Ursa.Controls; @@ -72,9 +71,9 @@ public class DualBadge : HeaderedContentControl ContentProperty.Changed.AddClassHandler((o, args) => o.OnContentChanged()); } - protected override void OnLoaded(RoutedEventArgs e) + protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { - base.OnLoaded(e); + base.OnApplyTemplate(e); OnIconChanged(); OnHeaderChanged(); OnContentChanged(); From 4c597a5d1cee85dad40a04eda31c4ffa53ad6e53 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Thu, 27 Jul 2023 23:51:07 +0800 Subject: [PATCH 07/13] fix: fix error. --- src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml index 9bf6a64..48bba04 100644 --- a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml @@ -1,12 +1,11 @@  White White - #FF888D92 - White + White From 45b2f5eb41cc85721e7f639900ad8201cbd11a69 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 28 Jul 2023 00:34:06 +0800 Subject: [PATCH 08/13] feat: add generic thickness/cornerradius converter. --- src/Ursa.Themes.Semi/Controls/DualBadge.axaml | 11 +-- src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj | 6 +- src/Ursa/Converters/CornerRadiusConverter.cs | 90 ++++++++++++++++++ src/Ursa/Converters/ThicknessConverter.cs | 91 +++++++++++++++++++ src/Ursa/Ursa.csproj | 4 +- 5 files changed, 191 insertions(+), 11 deletions(-) create mode 100644 src/Ursa/Converters/CornerRadiusConverter.cs create mode 100644 src/Ursa/Converters/ThicknessConverter.cs diff --git a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml index 4cfb62f..af0c658 100644 --- a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -1,7 +1,8 @@  + xmlns:u="https://irihi.tech/ursa" + xmlns:converters="clr-namespace:Ursa.Converters;assembly=Ursa"> @@ -30,10 +31,9 @@ Name="{x:Static u:DualBadge.PART_Icon}" Width="14" Height="14" - Margin="2 0 0 0" IsVisible="{TemplateBinding Icon,Converter={x:Static ObjectConverters.IsNotNull}}" Foreground="{TemplateBinding IconForeground}" - Padding="{TemplateBinding Padding}" + Margin="{TemplateBinding Padding, Converter={x:Static converters:ThicknessExcludeConverter.Right}}" Content="{TemplateBinding Icon}" ContentTemplate="{TemplateBinding IconTemplate}" /> @@ -84,7 +84,6 @@ BasedOn="{StaticResource {x:Type u:DualBadge}}" TargetType="u:DualBadge"> - - + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj b/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj index 5bb0d73..88fc18f 100644 --- a/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj +++ b/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj @@ -1,6 +1,6 @@ - + netstandard2.0 @@ -13,11 +13,11 @@ - + - + diff --git a/src/Ursa/Converters/CornerRadiusConverter.cs b/src/Ursa/Converters/CornerRadiusConverter.cs new file mode 100644 index 0000000..a5e041a --- /dev/null +++ b/src/Ursa/Converters/CornerRadiusConverter.cs @@ -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(); + } +} \ No newline at end of file diff --git a/src/Ursa/Converters/ThicknessConverter.cs b/src/Ursa/Converters/ThicknessConverter.cs new file mode 100644 index 0000000..6073cf0 --- /dev/null +++ b/src/Ursa/Converters/ThicknessConverter.cs @@ -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(); + } +} \ No newline at end of file diff --git a/src/Ursa/Ursa.csproj b/src/Ursa/Ursa.csproj index 01a32db..a6c5201 100644 --- a/src/Ursa/Ursa.csproj +++ b/src/Ursa/Ursa.csproj @@ -1,6 +1,6 @@ - + netstandard2.0 @@ -13,7 +13,7 @@ - + From 33761cf80c2180bf7c7b46c205b64b0fde6d11ae Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Fri, 28 Jul 2023 00:55:18 +0800 Subject: [PATCH 09/13] feat: use Classes instead of Themes. --- demo/Ursa.Demo/Pages/DualBadgeDemo.axaml | 223 ++++++++++-------- src/Ursa.Themes.Semi/Controls/DualBadge.axaml | 38 ++- .../Themes/Dark/DualBadge.axaml | 10 +- .../Themes/Light/DualBadge.axaml | 11 +- 4 files changed, 164 insertions(+), 118 deletions(-) diff --git a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml index c3fb94d..83e4098 100644 --- a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml +++ b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml @@ -8,101 +8,140 @@ d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d"> - - - 2.4k - - - - - - 2.4k - + + + - - 2.4k - + + + + + + 2.4k + + + + + + 2.4k + + + 2.4k + + + + + + 2.4k + + - - - - - 2.4k - + + + + 2.4k + + + + + + 2.4k + + + 2.4k + + + + + + 2.4k + + - - - - 2.4K - - - - - - - 2.4K - - - - 2.4K - - - - - - - 2.4K - - + + + + 2.4K + + + + + + 2.4K + + + 2.4K + + + + + + 2.4K + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml index af0c658..e0a040f 100644 --- a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -59,31 +59,23 @@ + + + + + + - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml index 48bba04..72e804c 100644 --- a/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Dark/DualBadge.axaml @@ -1,13 +1,21 @@  White White + White - White + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml index 6249aa8..72e804c 100644 --- a/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Themes/Light/DualBadge.axaml @@ -1,14 +1,21 @@  White White + White - White - + + + + + + + + \ No newline at end of file From 2fd76aefb0a65fefdff5d4d6fc868bcfb135b752 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Fri, 28 Jul 2023 01:30:39 +0800 Subject: [PATCH 10/13] feat: add color Classes. --- demo/Ursa.Demo/Pages/DualBadgeDemo.axaml | 77 ++++++++++- src/Ursa.Themes.Semi/Controls/DualBadge.axaml | 100 +++++++++++++- .../Themes/Dark/DualBadge.axaml | 128 +++++++++++++++++- .../Themes/Light/DualBadge.axaml | 128 +++++++++++++++++- 4 files changed, 425 insertions(+), 8 deletions(-) diff --git a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml index 83e4098..2dd1acb 100644 --- a/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml +++ b/demo/Ursa.Demo/Pages/DualBadgeDemo.axaml @@ -10,8 +10,8 @@ mc:Ignorable="d"> - @@ -142,6 +142,79 @@ 2.4K + + + Red + Pink + Purple + Violet + Indigo + Blue + LightBlue + Cyan + Teal + Green + LightGreen + Lime + Yellow + Amber + Orange + Grey + + + Red + Pink + Purple + Violet + Indigo + Blue + LightBlue + Cyan + Teal + Green + LightGreen + Lime + Yellow + Amber + Orange + Grey + + + Red + Pink + Purple + Violet + Indigo + Blue + LightBlue + Cyan + Teal + Green + LightGreen + Lime + Yellow + Amber + Orange + Grey + + + Red + Pink + Purple + Violet + Indigo + Blue + LightBlue + Cyan + Teal + Green + LightGreen + Lime + Yellow + Amber + Orange + Grey + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml index e0a040f..404ecfe 100644 --- a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -10,7 +10,7 @@ - + @@ -59,6 +59,55 @@ + + + + + + + + + + + + + + + + + @@ -66,7 +115,54 @@ + + + + + + + + + + + + + + +