Browse Source

150 ms opacity transition duration for ToolTip

pull/4071/head
Max Katz 6 years ago
parent
commit
bcd215e3db
  1. 76
      src/Avalonia.Themes.Fluent/ToolTip.xaml

76
src/Avalonia.Themes.Fluent/ToolTip.xaml

@ -1,39 +1,39 @@
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith> <Design.PreviewWith>
<Grid RowDefinitions="Auto,Auto" <Grid RowDefinitions="Auto,Auto"
ColumnDefinitions="Auto,Auto" ColumnDefinitions="Auto,Auto"
HorizontalAlignment="Center"> HorizontalAlignment="Center">
<Border Grid.Column="0" <Border Grid.Column="0"
Grid.Row="1" Grid.Row="1"
Background="{DynamicResource ThemeAccentBrush}" Background="{DynamicResource ThemeAccentBrush}"
Margin="5"
Padding="50"
ToolTip.Tip="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.">
<TextBlock>Hover Here</TextBlock>
</Border>
<CheckBox Grid.Column="1"
Margin="5" Margin="5"
Padding="50" Grid.Row="0"
ToolTip.Tip="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."> IsChecked="{Binding ElementName=Border, Path=(ToolTip.IsOpen)}"
<TextBlock>Hover Here</TextBlock> Content="ToolTip Open" />
</Border> <Border Name="Border"
<CheckBox Grid.Column="1" Grid.Column="1"
Margin="5" Grid.Row="1"
Grid.Row="0" Background="{DynamicResource ThemeAccentBrush}"
IsChecked="{Binding ElementName=Border, Path=(ToolTip.IsOpen)}" Margin="5"
Content="ToolTip Open" /> Padding="50"
<Border Name="Border" ToolTip.Placement="Bottom">
Grid.Column="1" <ToolTip.Tip>
Grid.Row="1" <StackPanel>
Background="{DynamicResource ThemeAccentBrush}" <TextBlock Classes="h1">ToolTip</TextBlock>
Margin="5" <TextBlock Classes="h2">A control which pops up a hint when a control is hovered</TextBlock>
Padding="50" </StackPanel>
ToolTip.Placement="Bottom"> </ToolTip.Tip>
<ToolTip.Tip> <TextBlock>ToolTip bottom placement</TextBlock>
<StackPanel> </Border>
<TextBlock Classes="h1">ToolTip</TextBlock> </Grid>
<TextBlock Classes="h2">A control which pops up a hint when a control is hovered</TextBlock>
</StackPanel>
</ToolTip.Tip>
<TextBlock>ToolTip bottom placement</TextBlock>
</Border>
</Grid>
</Design.PreviewWith> </Design.PreviewWith>
<Style Selector="ToolTip"> <Style Selector="ToolTip">
<Setter Property="Foreground" Value="{DynamicResource ToolTipForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ToolTipForeground}" />
<Setter Property="Background" Value="{DynamicResource ToolTipBackground}" /> <Setter Property="Background" Value="{DynamicResource ToolTipBackground}" />
@ -44,7 +44,7 @@
<Setter Property="Padding" Value="{DynamicResource ToolTipBorderThemePadding}" /> <Setter Property="Padding" Value="{DynamicResource ToolTipBorderThemePadding}" />
<Setter Property="Transitions"> <Setter Property="Transitions">
<Transitions> <Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.2"/> <DoubleTransition Property="Opacity" Duration="0:0:0.15" />
</Transitions> </Transitions>
</Setter> </Setter>
<Setter Property="Template"> <Setter Property="Template">
@ -58,21 +58,21 @@
<ContentPresenter Name="PART_ContentPresenter" <ContentPresenter Name="PART_ContentPresenter"
MaxWidth="320" MaxWidth="320"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"/> ContentTemplate="{TemplateBinding ContentTemplate}" />
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="ToolTip > TextBlock"> <Style Selector="ToolTip > TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/> <Setter Property="TextWrapping" Value="Wrap" />
</Style> </Style>
<Style Selector="ToolTip"> <Style Selector="ToolTip">
<Setter Property="Opacity" Value="0"/> <Setter Property="Opacity" Value="0" />
</Style> </Style>
<Style Selector="ToolTip:open"> <Style Selector="ToolTip:open">
<Setter Property="Opacity" Value="1"/> <Setter Property="Opacity" Value="1" />
</Style> </Style>
</Styles> </Styles>

Loading…
Cancel
Save