mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-24 02:09:37 +08:00
Add OverlayPopupHost Themes
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:themes="using:AtomUI.Controls.Themes"
|
||||
xmlns:atom="https://atomui.net">
|
||||
<ControlTheme x:Key="{x:Type OverlayPopupHost}" TargetType="OverlayPopupHost">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||
<VisualLayerManager IsPopup="True">
|
||||
<ContentPresenter Name="{x:Static themes:OverlayPopupHostThemeConstants.ContentPresenterPart}"
|
||||
Background="{TemplateBinding Background}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Content="{TemplateBinding Content}"
|
||||
Padding="{TemplateBinding Padding}" />
|
||||
</VisualLayerManager>
|
||||
</LayoutTransformControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static atom:SharedTokenKey.ColorText}}" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSize}}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontFamily}}" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="FontStyle" Value="Normal" />
|
||||
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -1,7 +1,8 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:themes="using:AtomUI.Controls.Themes">
|
||||
xmlns:themes="using:AtomUI.Controls.Themes"
|
||||
xmlns:atom="https://atomui.net">
|
||||
<ControlTheme x:Key="{x:Type PopupRoot}" TargetType="PopupRoot">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
@@ -20,5 +21,14 @@
|
||||
</LayoutTransformControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static atom:SharedTokenKey.ColorText}}" />
|
||||
<Setter Property="TransparencyLevelHint" Value="Transparent" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSize}}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontFamily}}" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="FontStyle" Value="Normal" />
|
||||
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -1,7 +1,12 @@
|
||||
namespace AtomUI.Controls.Themes;
|
||||
|
||||
public static class PopupThemeConstants
|
||||
internal static class PopupThemeConstants
|
||||
{
|
||||
public const string TransparencyFallbackPart = "PART_TransparencyFallback";
|
||||
public const string ContentPresenterPart = "PART_ContentPresenter";
|
||||
}
|
||||
|
||||
internal static class OverlayPopupHostThemeConstants
|
||||
{
|
||||
public const string ContentPresenterPart = "PART_ContentPresenter";
|
||||
}
|
||||
Reference in New Issue
Block a user