From 021ca978659bbb83fac8e4fb719473237f8a6b62 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Sat, 9 Nov 2024 04:13:00 +0800 Subject: [PATCH] feat: redesign GroupBox theme for HeaderedContentControl. Header & Content are now invisible when set to null. SeparatorBorder is now influenced by BorderThickness. Background is no longer transparent. --- .../Pages/HeaderedContentControlDemo.axaml | 18 ++-- demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 80 +++++++++-------- .../Pages/SelectableTextBlock.axaml | 83 +++++++++--------- .../Pages/TextBlockDemo.axaml | 75 ++++++++-------- .../Controls/HeaderedContentControl.axaml | 86 ++++++++++++------- .../Themes/Dark/HeaderedContentControl.axaml | 4 +- .../HighContrast/HeaderedContentControl.axaml | 4 +- .../Themes/Light/HeaderedContentControl.axaml | 4 +- .../Shared/HeaderedContentControl.axaml | 6 +- 9 files changed, 200 insertions(+), 160 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml index af62a80..b778b13 100644 --- a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml @@ -2,7 +2,7 @@ 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" - mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="1450" x:Class="Semi.Avalonia.Demo.Pages.HeaderedContentControlDemo"> @@ -27,12 +27,18 @@ GroupBox Theme - Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。 + HorizontalAlignment="Left" + MaxWidth="360"> + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml index 5b17250..250c794 100644 --- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml @@ -4,7 +4,7 @@ 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" - d:DesignHeight="450" + d:DesignHeight="800" d:DesignWidth="800" mc:Ignorable="d"> @@ -13,15 +13,13 @@ + - - - - Classes - - - Secondary - Tertiary - Quaternary - Success - Warning - Danger - Mark - Code - + RowDefinitions="*,*,*,*,*,*,*,*,*,*,*"> + Classes + - + Secondary + Tertiary + Quaternary + Success + Warning + Danger + Mark + Code + diff --git a/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml b/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml index e70aeee..c568f0c 100644 --- a/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml +++ b/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml @@ -1,7 +1,31 @@  + + + + + + + + + + + + + + + + @@ -12,31 +36,31 @@ CornerRadius="{TemplateBinding CornerRadius}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"> - + + FontStyle="{TemplateBinding FontStyle}" /> + FontStyle="{TemplateBinding FontStyle}" /> @@ -44,42 +68,46 @@ - - - + + + - - - - + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> + - + + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource SeparatorBorderMultiplier}}"> + + + + + + + + TextWrapping="Wrap" /> diff --git a/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml b/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml index c5804df..56bc792 100644 --- a/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml +++ b/src/Semi.Avalonia/Themes/Dark/HeaderedContentControl.axaml @@ -1,4 +1,4 @@  - - + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/HighContrast/HeaderedContentControl.axaml b/src/Semi.Avalonia/Themes/HighContrast/HeaderedContentControl.axaml index 2d0c943..de0dd5e 100644 --- a/src/Semi.Avalonia/Themes/HighContrast/HeaderedContentControl.axaml +++ b/src/Semi.Avalonia/Themes/HighContrast/HeaderedContentControl.axaml @@ -1,4 +1,4 @@  - - + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/HeaderedContentControl.axaml b/src/Semi.Avalonia/Themes/Light/HeaderedContentControl.axaml index ce87252..501435b 100644 --- a/src/Semi.Avalonia/Themes/Light/HeaderedContentControl.axaml +++ b/src/Semi.Avalonia/Themes/Light/HeaderedContentControl.axaml @@ -1,4 +1,4 @@  - - + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Shared/HeaderedContentControl.axaml b/src/Semi.Avalonia/Themes/Shared/HeaderedContentControl.axaml index c6e24ac..24289d5 100644 --- a/src/Semi.Avalonia/Themes/Shared/HeaderedContentControl.axaml +++ b/src/Semi.Avalonia/Themes/Shared/HeaderedContentControl.axaml @@ -1,3 +1,7 @@  - 4 + 6 + 1 + 600 + 20 + 20 \ No newline at end of file