Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TeachingTip: close button update #4771

Merged
merged 9 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions dev/TeachingTip/TeachingTip.xaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -617,18 +617,7 @@
</Grid>
</StackPanel>
</ScrollViewer>
<Button x:Name="AlternateCloseButton"
Width="{StaticResource TeachingTipAlternateCloseButtonSize}"
Height="{StaticResource TeachingTipAlternateCloseButtonSize}"
Background="Transparent"
VerticalAlignment="Top"
HorizontalAlignment="Right"
BorderThickness="{ThemeResource TeachingTipAlternateCloseButtonBorderThickness}">
<Viewbox Width="{StaticResource TeachingTipAlternateCloseButtonGlyphSize}"
Height="{StaticResource TeachingTipAlternateCloseButtonGlyphSize}">
<SymbolIcon Symbol="Cancel"/>
</Viewbox>
</Button>
<Button x:Name="AlternateCloseButton" Style="{ThemeResource AlternateCloseButtonStyle}"/>
</Grid>
</Grid>
<Grid x:Name="TopHighlightLeft"
Expand Down
130 changes: 104 additions & 26 deletions dev/TeachingTip/TeachingTip_rs1_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,38 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.UI.Xaml.Controls">
xmlns:local="using:Microsoft.UI.Xaml.Controls"
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)">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<StaticResource x:Key="TeachingTipBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush"/>
<SolidColorBrush x:Key="TeachingTipTopHighlightBrush" Color="#0DFFFFFF"/>
<StaticResource x:Key="TeachingTipTransientBackground" ResourceKey="SolidBackgroundFillColorTertiaryBrush"/>
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SolidBackgroundFillColorTertiaryBrush"/>
<StaticResource x:Key="TeachingTipTitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipSubtitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush"/>
<SolidColorBrush x:Key="TeachingTipTopHighlightBrush" Color="#0DFFFFFF"/>
beervoley marked this conversation as resolved.
Show resolved Hide resolved
<StaticResource x:Key="TeachingTipTransientBackground" ResourceKey="SolidBackgroundFillColorTertiaryBrush"/>
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SolidBackgroundFillColorTertiaryBrush"/>
<StaticResource x:Key="TeachingTipTitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipSubtitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<Thickness x:Key="TeachingTipAlternateCloseButtonBorderThickness">0</Thickness>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<StaticResource x:Key="TeachingTipBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush"/>
<SolidColorBrush x:Key="TeachingTipTopHighlightBrush" Color="#99FFFFFF"/>
<StaticResource x:Key="TeachingTipTransientBackground" ResourceKey="SolidBackgroundFillColorTertiaryBrush"/>
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SolidBackgroundFillColorTertiaryBrush"/>
<StaticResource x:Key="TeachingTipTitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipSubtitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush"/>
<SolidColorBrush x:Key="TeachingTipTopHighlightBrush" Color="#99FFFFFF"/>
<StaticResource x:Key="TeachingTipTransientBackground" ResourceKey="SolidBackgroundFillColorTertiaryBrush"/>
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SolidBackgroundFillColorTertiaryBrush"/>
<StaticResource x:Key="TeachingTipTitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipSubtitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<Thickness x:Key="TeachingTipAlternateCloseButtonBorderThickness">0</Thickness>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<StaticResource x:Key="TeachingTipBorderBrush" ResourceKey="SystemControlTransientBorderBrush"/>
<SolidColorBrush x:Key="TeachingTipTopHighlightBrush" Color="Transparent"/>
<StaticResource x:Key="TeachingTipTransientBackground" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="TeachingTipTitleForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush"/>
<StaticResource x:Key="TeachingTipSubtitleForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush"/>
<StaticResource x:Key="TeachingTipBorderBrush" ResourceKey="SystemControlTransientBorderBrush"/>
<SolidColorBrush x:Key="TeachingTipTopHighlightBrush" Color="Transparent"/>
<StaticResource x:Key="TeachingTipTransientBackground" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="TeachingTipTitleForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush"/>
<StaticResource x:Key="TeachingTipSubtitleForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush"/>
<Thickness x:Key="TeachingTipAlternateCloseButtonBorderThickness">2</Thickness>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
Expand All @@ -41,8 +43,8 @@
<x:Double x:Key="TeachingTipMinWidth">320</x:Double>
<x:Double x:Key="TeachingTipMaxWidth">336</x:Double>

<Thickness x:Key="TeachingTipRightButtonMargin">6,12,0,0</Thickness>
<Thickness x:Key="TeachingTipLeftButtonMargin">0,12,6,0</Thickness>
<Thickness x:Key="TeachingTipRightButtonMargin">4,12,0,0</Thickness>
<Thickness x:Key="TeachingTipLeftButtonMargin">0,12,4,0</Thickness>

<Thickness x:Key="TeachingTipMainContentPresentMargin">0,12,0,0</Thickness>
<Thickness x:Key="TeachingTipMainContentAbsentMargin">0,0,0,0</Thickness>
Expand All @@ -68,11 +70,87 @@
<GridLength x:Key="TeachingTipTailMargin">10</GridLength>

<x:Double x:Key="TeachingTipAlternateCloseButtonSize">40</x:Double>
<x:Double x:Key="TeachingTipAlternateCloseButtonGlyphSize">12</x:Double>

<x:Double x:Key="TeachingTipAlternateCloseButtonGlyphSize">16</x:Double>
<Thickness x:Key="TeachingTipContentMargin">12</Thickness>

<x:Double x:Key="TeachingTipTopHighlightHeight">1</x:Double>
<x:Double x:Key="TeachingTipBorderThickness">1</x:Double>
<Thickness x:Key="TeachingTipTopHighlightOffsetForBorder">0,1,0,0</Thickness>

<Style x:Key="AlternateCloseButtonStyle" TargetType="Button">
<Setter Property="Width" Value="{ThemeResource TeachingTipAlternateCloseButtonSize}" />
<Setter Property="Height" Value="{ThemeResource TeachingTipAlternateCloseButtonSize}" />
<Setter Property="Background" Value="{ThemeResource SubtleFillColorTransparentBrush}" />
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}" />
<Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource TeachingTipAlternateCloseButtonGlyphSize}" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Padding" Value="4"/>
<Setter Property="BorderThickness" Value="{ThemeResource TeachingTipAlternateCloseButtonBorderThickness}" />
<Setter Property="BorderBrush" Value="{ThemeResource ControlElevationBorderBrush}" />
<Setter Property="Content" Value="&#xE711;"/>
<contract7Present:Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}"/>
<Setter Property="FocusVisualMargin" Value="1"/>
<Setter Property="Template">
beervoley marked this conversation as resolved.
Show resolved Hide resolved
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Padding="{TemplateBinding Padding}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SubtleFillColorSecondaryBrush}"/>
</ObjectAnimationUsingKeyFrames>
beervoley marked this conversation as resolved.
Show resolved Hide resolved
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SubtleFillColorTertiaryBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextFillColorSecondaryBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SubtleFillColorTransparentBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextFillColorDisabledBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter"
AutomationProperties.AccessibilityView="Raw"
contract7Present:BackgroundSizing="{TemplateBinding BackgroundSizing}"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
Content="{TemplateBinding Content}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
contract7Present:CornerRadius="{TemplateBinding CornerRadius}"
contract7NotPresent:CornerRadius="{ThemeResource ControlCornerRadius}">
</ContentPresenter>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>