Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara committed Nov 15, 2022
1 parent 9cab4e9 commit 0507a50
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 25 deletions.
32 changes: 17 additions & 15 deletions ModernWpf/Styles/ToolTip.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ModernWpf.Controls"
xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives">
xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives"
xmlns:sys="clr-namespace:System;assembly=mscorlib">

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

<Style x:Key="DefaultToolTipStyle" TargetType="ToolTip">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource ToolTipForeground}" />
<Setter Property="Background" Value="{DynamicResource ToolTipBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ToolTipForegroundBrush}" />
<Setter Property="Background" Value="{DynamicResource ToolTipBackgroundBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToolTipBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ToolTipBorderThemeThickness}" />
<Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.StatusFontFamilyKey}}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="{DynamicResource ToolTipContentThemeFontSize}" />
<Setter Property="Padding" Value="{DynamicResource ToolTipBorderThemePadding}" />
<Setter Property="primitives:ControlHelper.CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
<Setter Property="Padding" Value="{StaticResource ToolTipBorderPadding}" />
<Setter Property="MaxWidth" Value="{StaticResource ToolTipMaxWidth}" />
<Setter Property="primitives:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="HasDropShadow" Value="{DynamicResource {x:Static SystemParameters.DropShadowKey}}" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
<Setter Property="SnapsToDevicePixels" Value="true" />
Expand All @@ -25,21 +30,18 @@
<primitives:ThemeShadowChrome
Depth="16"
IsShadowEnabled="{TemplateBinding HasDropShadow}"
MaxWidth="320"
MaxWidth="{TemplateBinding MaxWidth}"
CornerRadius="{TemplateBinding primitives:ControlHelper.CornerRadius}"
SnapsToDevicePixels="True">
<Border
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
Padding="{TemplateBinding Padding}"
CornerRadius="{TemplateBinding primitives:ControlHelper.CornerRadius}">
<Border
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
CornerRadius="{TemplateBinding primitives:ControlHelper.CornerRadius}">
<local:ContentPresenterEx
TextWrapping="Wrap"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<local:ContentPresenterEx
TextWrapping="Wrap"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</primitives:ThemeShadowChrome>
</ControlTemplate>
Expand Down
5 changes: 2 additions & 3 deletions ModernWpf/ThemeResources/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1635,9 +1635,8 @@
<!-- Resources for ToolTip -->
<sys:Double x:Key="ToolTipContentThemeFontSize">12</sys:Double>
<Thickness x:Key="ToolTipBorderThemeThickness">1</Thickness>
<Thickness x:Key="ToolTipBorderThemePadding">8,5,8,7</Thickness>
<m:StaticResource x:Key="ToolTipForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<m:StaticResource x:Key="ToolTipBackground" ResourceKey="SystemControlBackgroundChromeMediumLowBrush" />
<m:StaticResource x:Key="ToolTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush" />
<m:StaticResource x:Key="ToolTipBackgroundBrush" ResourceKey="AcrylicBackgroundFillColorDefaultBrush" />
<m:StaticResource x:Key="ToolTipBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush" />

<!-- Resources for TreeView -->
Expand Down
7 changes: 3 additions & 4 deletions ModernWpf/ThemeResources/HighContrast.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1513,10 +1513,9 @@
<!-- Resources for ToolTip -->
<sys:Double x:Key="ToolTipContentThemeFontSize">12</sys:Double>
<Thickness x:Key="ToolTipBorderThemeThickness">1</Thickness>
<Thickness x:Key="ToolTipBorderThemePadding">8,5,8,7</Thickness>
<m:StaticResource x:Key="ToolTipForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<m:StaticResource x:Key="ToolTipBackground" ResourceKey="SystemControlBackgroundChromeMediumLowBrush" />
<m:StaticResource x:Key="ToolTipBorderBrush" ResourceKey="SystemControlTransientBorderBrush" />
<m:StaticResource x:Key="ToolTipForegroundBrush" ResourceKey="SystemColorWindowTextColorBrush" />
<m:StaticResource x:Key="ToolTipBackgroundBrush" ResourceKey="SystemColorWindowColorBrush" />
<m:StaticResource x:Key="ToolTipBorderBrush" ResourceKey="SystemColorWindowTextColorBrush" />

<!-- Resources for TreeView -->
<m:StaticResource x:Key="TreeViewItemBackground" ResourceKey="SystemControlTransparentRevealBackgroundBrush" />
Expand Down
5 changes: 2 additions & 3 deletions ModernWpf/ThemeResources/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1634,9 +1634,8 @@
<!-- Resources for ToolTip -->
<sys:Double x:Key="ToolTipContentThemeFontSize">12</sys:Double>
<Thickness x:Key="ToolTipBorderThemeThickness">1</Thickness>
<Thickness x:Key="ToolTipBorderThemePadding">8,5,8,7</Thickness>
<m:StaticResource x:Key="ToolTipForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<m:StaticResource x:Key="ToolTipBackground" ResourceKey="SystemControlBackgroundChromeMediumLowBrush" />
<m:StaticResource x:Key="ToolTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush" />
<m:StaticResource x:Key="ToolTipBackgroundBrush" ResourceKey="AcrylicBackgroundFillColorDefaultBrush" />
<m:StaticResource x:Key="ToolTipBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush" />

<!-- Resources for TreeView -->
Expand Down

0 comments on commit 0507a50

Please sign in to comment.