Skip to content

Commit

Permalink
Tooltip visual updates (#4077)
Browse files Browse the repository at this point in the history
* bug fixes

* tooltip visual updates

* updating to desired design afrer review

* inner border edge

* inner border edge

* feedback

* max width
  • Loading branch information
tashatitova authored Feb 2, 2021
1 parent fdab700 commit 6b095b1
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions dev/ToolTip/ToolTip_rs5_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,59 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<StaticResource x:Key="ToolTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="ToolTipBackgroundBrush" ResourceKey="AcrylicBackgroundFillColorDefaultBrush" />
<StaticResource x:Key="ToolTipBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush" />
<Thickness x:Key="ToolTipBorderThemePadding">8,5,8,7</Thickness>
</ResourceDictionary>

<ResourceDictionary x:Key="HighContrast">
<StaticResource x:Key="ToolTipBorderBrush" ResourceKey="SystemControlTransientBorderBrush" />
<Thickness x:Key="ToolTipBorderThemePadding">8,5,8,7</Thickness>
</ResourceDictionary>

<ResourceDictionary x:Key="Light">
<StaticResource x:Key="ToolTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="ToolTipBackgroundBrush" ResourceKey="AcrylicBackgroundFillColorDefaultBrush" />
<StaticResource x:Key="ToolTipBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush" />
<Thickness x:Key="ToolTipBorderThemePadding">8,5,8,7</Thickness>
</ResourceDictionary>

<ResourceDictionary x:Key="HighContrast">
<StaticResource x:Key="ToolTipForegroundBrush" ResourceKey="SystemColorWindowTextColorBrush" />
<StaticResource x:Key="ToolTipBackgroundBrush" ResourceKey="SystemColorWindowColorBrush" />
<StaticResource x:Key="ToolTipBorderBrush" ResourceKey="SystemColorWindowTextColorBrush" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Thickness x:Key="ToolTipBorderPadding">9,6,9,8</Thickness>
<x:Double x:Key="ToolTipMaxWidth">320</x:Double>

<Style TargetType="ToolTip" BasedOn="{StaticResource DefaultToolTipStyle}" />

<Style x:Key="DefaultToolTipStyle" TargetType="ToolTip">
<Setter Property="Foreground" Value="{ThemeResource ToolTipForeground}" />
<Setter Property="Background" Value="{ThemeResource ToolTipBackground}" />
<Setter Property="Foreground" Value="{ThemeResource ToolTipForegroundBrush}" />
<Setter Property="Background" Value="{ThemeResource ToolTipBackgroundBrush}" />
<contract7Present:Setter Property="BackgroundSizing" Value="InnerBorderEdge" />
<Setter Property="BorderBrush" Value="{ThemeResource ToolTipBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource ToolTipBorderThemeThickness}" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource ToolTipContentThemeFontSize}" />
<Setter Property="Padding" Value="{ThemeResource ToolTipBorderThemePadding}" />
<contract7Present:Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
<Setter Property="Padding" Value="{StaticResource ToolTipBorderPadding}" />
<Setter Property="MaxWidth" Value="{StaticResource ToolTipMaxWidth}" />
<contract7Present:Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToolTip">
<ContentPresenter x:Name="LayoutRoot"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
BackgroundSizing="OuterBorderEdge"
contract7Present:BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
MaxWidth="320"
MaxWidth="{TemplateBinding MaxWidth}"
Content="{TemplateBinding Content}"
ContentTransitions="{TemplateBinding ContentTransitions}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Padding="{TemplateBinding Padding}"
TextWrapping="Wrap"
contract7Present:CornerRadius="{TemplateBinding CornerRadius}"
contract7NotPresent:CornerRadius="{ThemeResource OverlayCornerRadius}">
contract7Present:CornerRadius="{TemplateBinding CornerRadius}">

<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="OpenStates">
Expand Down

0 comments on commit 6b095b1

Please sign in to comment.