From f0b6c4ecf9c584d05222da3f22c5a608aaaa55fa Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 27 Sep 2024 23:56:26 +0800 Subject: [PATCH 1/8] feat: try to implement Aqua. --- demo/Ursa.Demo/App.axaml | 4 +- demo/Ursa.Demo/Ursa.Demo.csproj | 8 ++ src/Ursa.Themes.Semi/Controls/Banner.axaml | 2 +- src/Ursa.Themes.Semi/Index.axaml | 7 +- src/Ursa.Themes.Semi/Index.axaml.cs | 5 + src/Ursa.Themes.Semi/Themes/Dark/Banner.axaml | 1 + .../Themes/HighContrast/Aquatic.axaml | 15 +++ .../Themes/HighContrast/Base.axaml | 102 ++++++++++++++++++ .../Themes/Light/Banner.axaml | 1 + 9 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 src/Ursa.Themes.Semi/Themes/HighContrast/Aquatic.axaml create mode 100644 src/Ursa.Themes.Semi/Themes/HighContrast/Base.axaml diff --git a/demo/Ursa.Demo/App.axaml b/demo/Ursa.Demo/App.axaml index 418891c..49bdfce 100644 --- a/demo/Ursa.Demo/App.axaml +++ b/demo/Ursa.Demo/App.axaml @@ -3,7 +3,9 @@ xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:u-semi="https://irihi.tech/ursa/themes/semi" - xmlns:semi="https://irihi.tech/semi"> + RequestedThemeVariant="{x:Static semi:SemiTheme.Aquatic}" + xmlns:semi="https://irihi.tech/semi" + xmlns:demo="clr-namespace:Ursa.Demo"> diff --git a/demo/Ursa.Demo/Ursa.Demo.csproj b/demo/Ursa.Demo/Ursa.Demo.csproj index 5e0a1c4..bf8cd04 100644 --- a/demo/Ursa.Demo/Ursa.Demo.csproj +++ b/demo/Ursa.Demo/Ursa.Demo.csproj @@ -19,7 +19,9 @@ + @@ -30,4 +32,10 @@ + + + + Assets\Semi.Avalonia.dll + + diff --git a/src/Ursa.Themes.Semi/Controls/Banner.axaml b/src/Ursa.Themes.Semi/Controls/Banner.axaml index 8624194..ff2767a 100644 --- a/src/Ursa.Themes.Semi/Controls/Banner.axaml +++ b/src/Ursa.Themes.Semi/Controls/Banner.axaml @@ -5,7 +5,7 @@ - + diff --git a/src/Ursa.Themes.Semi/Index.axaml b/src/Ursa.Themes.Semi/Index.axaml index f22145c..2f45fea 100644 --- a/src/Ursa.Themes.Semi/Index.axaml +++ b/src/Ursa.Themes.Semi/Index.axaml @@ -1,9 +1,14 @@ - + + + + + diff --git a/src/Ursa.Themes.Semi/Index.axaml.cs b/src/Ursa.Themes.Semi/Index.axaml.cs index 603e65a..6a61fe7 100644 --- a/src/Ursa.Themes.Semi/Index.axaml.cs +++ b/src/Ursa.Themes.Semi/Index.axaml.cs @@ -11,6 +11,11 @@ namespace Ursa.Themes.Semi; /// public class SemiTheme: Styles { + public static ThemeVariant Aquatic => new ThemeVariant(nameof(Aquatic), ThemeVariant.Dark); + public static ThemeVariant Desert => new ThemeVariant(nameof(Desert), ThemeVariant.Light); + public static ThemeVariant Dust => new ThemeVariant(nameof(Dust), ThemeVariant.Dark); + public static ThemeVariant NightSky => new ThemeVariant(nameof(NightSky), ThemeVariant.Dark); + private static readonly Lazy> _localeToResource = new Lazy>( () => new Dictionary { diff --git a/src/Ursa.Themes.Semi/Themes/Dark/Banner.axaml b/src/Ursa.Themes.Semi/Themes/Dark/Banner.axaml index 77feaa4..39f624e 100644 --- a/src/Ursa.Themes.Semi/Themes/Dark/Banner.axaml +++ b/src/Ursa.Themes.Semi/Themes/Dark/Banner.axaml @@ -10,4 +10,5 @@ + diff --git a/src/Ursa.Themes.Semi/Themes/HighContrast/Aquatic.axaml b/src/Ursa.Themes.Semi/Themes/HighContrast/Aquatic.axaml new file mode 100644 index 0000000..a388435 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/HighContrast/Aquatic.axaml @@ -0,0 +1,15 @@ + + + #202020 + #FFFFFF + #75E9FC + #A6A6A6 + #263B50 + #8EE3F0 + #FFFFFF + #202020 + + + + diff --git a/src/Ursa.Themes.Semi/Themes/HighContrast/Base.axaml b/src/Ursa.Themes.Semi/Themes/HighContrast/Base.axaml new file mode 100644 index 0000000..62ea19a --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/HighContrast/Base.axaml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Themes/Light/Banner.axaml b/src/Ursa.Themes.Semi/Themes/Light/Banner.axaml index e86efb3..f86be17 100644 --- a/src/Ursa.Themes.Semi/Themes/Light/Banner.axaml +++ b/src/Ursa.Themes.Semi/Themes/Light/Banner.axaml @@ -10,4 +10,5 @@ + From 318996812866416c1061d974041f28d592e5a785 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Wed, 2 Oct 2024 18:06:55 +0800 Subject: [PATCH 2/8] feat: more controls. --- demo/Ursa.Demo/Ursa.Demo.csproj | 4 +- src/Ursa.Themes.Semi/Controls/IPv4Box.axaml | 36 ++++++++++-------- .../Controls/KeyGestureInput.axaml | 23 ++++++----- .../Controls/MultiComboBox.axaml | 2 +- src/Ursa.Themes.Semi/Controls/NavMenu.axaml | 16 +++++--- src/Ursa.Themes.Semi/Controls/PinCode.axaml | 2 + .../Controls/TreeComboBox.axaml | 1 + .../Themes/Dark/IPv4Box.axaml | 12 ------ .../Themes/Dark/KeyGestureInput.axaml | 9 ----- .../Themes/Dark/NavigationMenu.axaml | 5 --- src/Ursa.Themes.Semi/Themes/Dark/_index.axaml | 2 - .../Themes/HighContrast/Base.axaml | 1 + .../Themes/Light/IPv4Box.axaml | 12 ------ .../Themes/Light/KeyGestureInput.axaml | 9 ----- .../Themes/Light/NavigationMenu.axaml | 5 --- .../Themes/Light/_index.axaml | 38 +++++++++---------- .../Themes/Shared/IPv4Box.axaml | 8 ---- .../Themes/Shared/KeyGestureInput.axaml | 7 ---- .../Themes/Shared/_index.axaml | 2 - 19 files changed, 66 insertions(+), 128 deletions(-) delete mode 100644 src/Ursa.Themes.Semi/Themes/Dark/IPv4Box.axaml delete mode 100644 src/Ursa.Themes.Semi/Themes/Dark/KeyGestureInput.axaml delete mode 100644 src/Ursa.Themes.Semi/Themes/Light/IPv4Box.axaml delete mode 100644 src/Ursa.Themes.Semi/Themes/Light/KeyGestureInput.axaml delete mode 100644 src/Ursa.Themes.Semi/Themes/Shared/IPv4Box.axaml delete mode 100644 src/Ursa.Themes.Semi/Themes/Shared/KeyGestureInput.axaml diff --git a/demo/Ursa.Demo/Ursa.Demo.csproj b/demo/Ursa.Demo/Ursa.Demo.csproj index bf8cd04..660a5d6 100644 --- a/demo/Ursa.Demo/Ursa.Demo.csproj +++ b/demo/Ursa.Demo/Ursa.Demo.csproj @@ -19,9 +19,7 @@ - + diff --git a/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml b/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml index 1c9e18a..636a707 100644 --- a/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml +++ b/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml @@ -30,18 +30,19 @@ Header="Clear" /> - - - - - - - - - - - - + + + + + + + + + + + + + @@ -113,17 +114,20 @@ diff --git a/src/Ursa.Themes.Semi/Controls/KeyGestureInput.axaml b/src/Ursa.Themes.Semi/Controls/KeyGestureInput.axaml index 9548bd9..c8865d5 100644 --- a/src/Ursa.Themes.Semi/Controls/KeyGestureInput.axaml +++ b/src/Ursa.Themes.Semi/Controls/KeyGestureInput.axaml @@ -7,12 +7,11 @@ - - - - - - + + + + + @@ -67,18 +66,18 @@ + diff --git a/src/Ursa.Themes.Semi/Controls/SelectionList.axaml b/src/Ursa.Themes.Semi/Controls/SelectionList.axaml index 3a7138c..e41ca89 100644 --- a/src/Ursa.Themes.Semi/Controls/SelectionList.axaml +++ b/src/Ursa.Themes.Semi/Controls/SelectionList.axaml @@ -10,7 +10,7 @@ Margin="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - Background="{DynamicResource SemiBlue1}" + Background="{DynamicResource SelectionListIndicatorBackground}" Theme="{DynamicResource CardBorder}" /> diff --git a/src/Ursa.Themes.Semi/Controls/TagInput.axaml b/src/Ursa.Themes.Semi/Controls/TagInput.axaml index 6357f4a..40ef851 100644 --- a/src/Ursa.Themes.Semi/Controls/TagInput.axaml +++ b/src/Ursa.Themes.Semi/Controls/TagInput.axaml @@ -6,7 +6,7 @@ - + @@ -22,8 +22,8 @@ VerticalAlignment="Stretch" Background="{DynamicResource TextBoxDefaultBackground}" BorderBrush="{DynamicResource TextBoxDefaultBorderBrush}" - BorderThickness="1" - CornerRadius="3"> + BorderThickness="{DynamicResource TextBoxBorderThickness}" + CornerRadius="{DynamicResource TextBoxDefaultCornerRadius}"> - - diff --git a/src/Ursa.Themes.Semi/Controls/TimeBox.axaml b/src/Ursa.Themes.Semi/Controls/TimeBox.axaml index 479b100..0eed466 100644 --- a/src/Ursa.Themes.Semi/Controls/TimeBox.axaml +++ b/src/Ursa.Themes.Semi/Controls/TimeBox.axaml @@ -1,52 +1,58 @@ - - + + - + - + - - - - - - - - - - - - + + + + + + + + + + + + + - - + - - + + - + - - + + - + - - + + - + - - + + @@ -135,20 +150,21 @@ diff --git a/src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml b/src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml index bf8bfcd..e5211dc 100644 --- a/src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml +++ b/src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml @@ -18,7 +18,7 @@ - + @@ -69,7 +69,7 @@ + Theme="{DynamicResource InnerIconButton}" /> + IsHitTestVisible="True" + UseLayoutRounding="False" /> + DockPanel.Dock="Top" + IsVisible="{TemplateBinding PopupInnerTopContent, + Converter={x:Static ObjectConverters.IsNotNull}}" /> + DockPanel.Dock="Bottom" + IsVisible="{TemplateBinding PopupInnerBottomContent, + Converter={x:Static ObjectConverters.IsNotNull}}" /> @@ -142,23 +142,23 @@ - + - + - + - + + + - + \ 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 9a9e949..79859b1 100644 --- a/src/Ursa.Themes.Semi/Controls/DualBadge.axaml +++ b/src/Ursa.Themes.Semi/Controls/DualBadge.axaml @@ -4,19 +4,19 @@ xmlns:u="https://irihi.tech/ursa" xmlns:converters="clr-namespace:Ursa.Converters;assembly=Ursa"> - - - - - - - - - - - - - + + + + + + + + + + + + + - + diff --git a/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml b/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml index 636a707..3dfbe75 100644 --- a/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml +++ b/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml @@ -43,8 +43,8 @@ - - + + @@ -150,10 +149,10 @@ @@ -176,9 +175,10 @@ @@ -254,4 +254,4 @@ - + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/Pagination.axaml b/src/Ursa.Themes.Semi/Controls/Pagination.axaml index 6b2eeca..558bede 100644 --- a/src/Ursa.Themes.Semi/Controls/Pagination.axaml +++ b/src/Ursa.Themes.Semi/Controls/Pagination.axaml @@ -52,7 +52,7 @@ - + diff --git a/src/Ursa.Themes.Semi/Controls/PinCode.axaml b/src/Ursa.Themes.Semi/Controls/PinCode.axaml index 5fcb719..e7b0066 100644 --- a/src/Ursa.Themes.Semi/Controls/PinCode.axaml +++ b/src/Ursa.Themes.Semi/Controls/PinCode.axaml @@ -11,7 +11,7 @@ - + diff --git a/src/Ursa.Themes.Semi/Controls/ScrollToButton.axaml b/src/Ursa.Themes.Semi/Controls/ScrollToButton.axaml index dc205d0..e0859d3 100644 --- a/src/Ursa.Themes.Semi/Controls/ScrollToButton.axaml +++ b/src/Ursa.Themes.Semi/Controls/ScrollToButton.axaml @@ -6,7 +6,7 @@ - + @@ -36,13 +36,13 @@ @@ -50,7 +50,7 @@ - + @@ -80,13 +80,13 @@ diff --git a/src/Ursa.Themes.Semi/Controls/SelectionList.axaml b/src/Ursa.Themes.Semi/Controls/SelectionList.axaml index e41ca89..b647d58 100644 --- a/src/Ursa.Themes.Semi/Controls/SelectionList.axaml +++ b/src/Ursa.Themes.Semi/Controls/SelectionList.axaml @@ -14,7 +14,7 @@ Theme="{DynamicResource CardBorder}" /> - + - + IsVisible="{TemplateBinding IsLoading}" /> - + IsVisible="{TemplateBinding IsLoading}" /> diff --git a/src/Ursa.Themes.Semi/Controls/TagInput.axaml b/src/Ursa.Themes.Semi/Controls/TagInput.axaml index 40ef851..e3a8732 100644 --- a/src/Ursa.Themes.Semi/Controls/TagInput.axaml +++ b/src/Ursa.Themes.Semi/Controls/TagInput.axaml @@ -49,7 +49,7 @@ diff --git a/src/Ursa.Themes.Semi/Controls/TimeBox.axaml b/src/Ursa.Themes.Semi/Controls/TimeBox.axaml index 0eed466..d19e56e 100644 --- a/src/Ursa.Themes.Semi/Controls/TimeBox.axaml +++ b/src/Ursa.Themes.Semi/Controls/TimeBox.axaml @@ -150,7 +150,7 @@ - + diff --git a/src/Ursa.Themes.Semi/Controls/Clock.axaml b/src/Ursa.Themes.Semi/Controls/Clock.axaml index 58809b8..dd62fb7 100644 --- a/src/Ursa.Themes.Semi/Controls/Clock.axaml +++ b/src/Ursa.Themes.Semi/Controls/Clock.axaml @@ -5,7 +5,7 @@ xmlns:u="https://irihi.tech/ursa"> - + @@ -13,8 +13,8 @@ ShowHourTicks="{TemplateBinding ShowHourTicks}" ShowMinuteTicks="{TemplateBinding ShowMinuteTicks}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - HourTickForeground="{DynamicResource SemiGrey6}" - MinuteTickForeground="{DynamicResource SemiGrey4}" /> + HourTickForeground="{DynamicResource ClockHourTickForeground}" + MinuteTickForeground="{DynamicResource ClockMinuteTickForeground}" /> diff --git a/src/Ursa.Themes.Semi/Controls/Form.axaml b/src/Ursa.Themes.Semi/Controls/Form.axaml index 6b424d1..4a987bd 100644 --- a/src/Ursa.Themes.Semi/Controls/Form.axaml +++ b/src/Ursa.Themes.Semi/Controls/Form.axaml @@ -38,7 +38,7 @@ Height="1" Margin="0,8" HorizontalAlignment="Stretch" - Fill="{DynamicResource SemiColorBorder}" + Fill="{DynamicResource FormGroupForeground}" IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Header, Converter={x:Static ObjectConverters.IsNotNull}}" /> @@ -64,7 +64,7 @@ FontWeight="{DynamicResource TextBlockTitleFontWeight}" Target="{Binding #PART_ContentPresenter.Content}" /> @@ -100,7 +100,7 @@ FontWeight="{DynamicResource TextBlockTitleFontWeight}" Target="{Binding #PART_ContentPresenter.Content}" /> diff --git a/src/Ursa.Themes.Semi/Controls/NavMenu.axaml b/src/Ursa.Themes.Semi/Controls/NavMenu.axaml index 273c5f3..d0eea3e 100644 --- a/src/Ursa.Themes.Semi/Controls/NavMenu.axaml +++ b/src/Ursa.Themes.Semi/Controls/NavMenu.axaml @@ -237,7 +237,7 @@ Height="{DynamicResource NavigationMenuSeparatorBorderHeight}" Margin="{DynamicResource NavigationMenuSeparatorBorderMargin}" HorizontalAlignment="Stretch" - Fill="{DynamicResource SemiColorBorder}" /> + Fill="{DynamicResource NavigationMenuItemSeparatorBorderForeground}" /> diff --git a/src/Ursa.Themes.Semi/Controls/Timeline.axaml b/src/Ursa.Themes.Semi/Controls/Timeline.axaml index 0d68e5c..926ee02 100644 --- a/src/Ursa.Themes.Semi/Controls/Timeline.axaml +++ b/src/Ursa.Themes.Semi/Controls/Timeline.axaml @@ -79,7 +79,7 @@ Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontSize="14" - Foreground="{DynamicResource SemiGrey9}" /> + Foreground="{DynamicResource TimelineHeaderForeground}" /> @@ -67,7 +67,7 @@ + Fill="{DynamicResource ToolBarSeparatorForeground}" />