Add EmbeddableControlRootTheme

This commit is contained in:
CHINBOY
2025-07-04 11:03:56 +08:00
parent 351d16b2f5
commit 6ee5eb415f
4 changed files with 39 additions and 1 deletions
@@ -17,6 +17,7 @@
<ResourceInclude Source="ComboBox/Themes/ComboBoxThemes.axaml" />
<ResourceInclude Source="DatePicker/Themes/DatePickerThemes.axaml" />
<ResourceInclude Source="Drawer/Themes/DrawerThemes.axaml" />
<ResourceInclude Source="Embedding/Themes/EmbeddableControlRootTheme.axaml" />
<ResourceInclude Source="EmptyIndicator/Themes/EmptyIndicatorTheme.axaml" />
<ResourceInclude Source="Expander/Themes/ExpanderTheme.axaml" />
<ResourceInclude Source="Flyouts/Themes/FlyoutThemes.axaml" />
@@ -0,0 +1,30 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:atom="https://atomui.net">
<ControlTheme x:Key="{x:Type EmbeddableControlRoot}" TargetType="EmbeddableControlRoot">
<Setter Property="Template">
<ControlTemplate>
<Panel>
<Border Name="{x:Static atom:EmbeddingThemeConstants.TransparencyFallbackPart}" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}">
<VisualLayerManager>
<ContentPresenter Name="{x:Static atom:EmbeddingThemeConstants.ContentPresenterPart}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Margin="{TemplateBinding Padding}"/>
</VisualLayerManager>
</Border>
</Panel>
</ControlTemplate>
</Setter>
<Setter Property="Background" Value="{DynamicResource {x:Static atom:WindowTokenKey.DefaultBackground}}" />
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource {x:Static atom:WindowTokenKey.DefaultBackground}}" />
<Setter Property="TopLevel.SystemBarColor" Value="{DynamicResource {x:Static atom:WindowTokenKey.SystemBarColor}}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static atom:WindowTokenKey.DefaultForeground}}" />
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSize}}" />
<Setter Property="FontFamily" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontFamily}}" />
</ControlTheme>
</ResourceDictionary>
@@ -0,0 +1,7 @@
namespace AtomUI.Controls.Themes;
internal static class EmbeddingThemeConstants
{
public const string TransparencyFallbackPart = "PART_TransparencyFallback";
public const string ContentPresenterPart = "PART_ContentPresenter";
}
@@ -31,7 +31,7 @@
Orientation="Vertical"
Grid.Row="0"
Grid.Column="1" />
<Panel x:Name="{x:Static atom:ScrollViewerThemeConstants.ScrollBarsSeparatorPart}"
<Panel Name="{x:Static atom:ScrollViewerThemeConstants.ScrollBarsSeparatorPart}"
Grid.Row="1"
Grid.Column="1"
Background="{DynamicResource {x:Static atom:SharedTokenKey.ColorBgContainer}}"