feat: add avalonia ToolTip style.

This commit is contained in:
NaBian committed 2025-08-13 21:19:23 +08:00
1 parent 7047087b73
commit 9697e99965
10 files changed
+110 -31

No files matched your search

@@ -2,17 +2,32 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="clr-namespace:HandyControl.Controls">
<Style x:Key="ToolTipBaseStyle" TargetType="ToolTip">
<Setter Property="Padding" Value="0,6"/>
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="hc:BorderElement.CornerRadius" Value="2"/>
<Style x:Key="ToolTipBaseStyle"
TargetType="ToolTip">
<Setter Property="Padding"
Value="{StaticResource DefaultControlPadding}" />
<Setter Property="Background"
Value="{DynamicResource RegionBrush}" />
<Setter Property="BorderBrush"
Value="{DynamicResource BorderBrush}" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="Foreground"
Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="FontSize"
Value="12" />
<Setter Property="hc:BorderElement.CornerRadius"
Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToolTip">
<Border Effect="{StaticResource EffectShadow2}" Margin="8" Background="{DynamicResource RegionBrush}" Padding="{TemplateBinding Padding}" BorderThickness="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}">
<ContentPresenter Margin="10,0"/>
<Border Effect="{StaticResource EffectShadow2}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
BorderThickness="1"
CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"
BorderBrush="{TemplateBinding BorderBrush}">
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
@@ -11577,16 +11577,18 @@
</Style.Triggers>
</Style>
<Style x:Key="ToolTipBaseStyle" TargetType="ToolTip">
<Setter Property="Padding" Value="0,6" />
<Setter Property="Background" Value="White" />
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="hc:BorderElement.CornerRadius" Value="2" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToolTip">
<Border Effect="{StaticResource EffectShadow2}" Margin="8" Background="{DynamicResource RegionBrush}" Padding="{TemplateBinding Padding}" BorderThickness="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}">
<ContentPresenter Margin="10,0" />
<Border Effect="{StaticResource EffectShadow2}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" BorderThickness="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}">
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>