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
12 changes: 1 addition & 11 deletions dev/TeachingTip/TeachingTip.xaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -618,17 +618,7 @@
</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>
Style="{ThemeResource AlternateCloseButtonStyle}"/>
beervoley marked this conversation as resolved.
Show resolved Hide resolved
</Grid>
</Grid>
<Grid x:Name="TopHighlightLeft"
Expand Down
157 changes: 131 additions & 26 deletions dev/TeachingTip/TeachingTip_rs1_themeresources.xaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,62 @@
<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="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="TeachingTipTitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipSubtitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush"/>
<StaticResource x:Key="TeachingTipAlternateCloseButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
<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="SystemControlPageBackgroundChromeLowBrush"/>
beervoley marked this conversation as resolved.
Show resolved Hide resolved
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<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="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="TeachingTipTitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipSubtitleForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush"/>
<StaticResource x:Key="TeachingTipAlternateCloseButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
<StaticResource x:Key="TeachingTipBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush"/>
<SolidColorBrush x:Key="TeachingTipTopHighlightBrush" Color="#99FFFFFF"/>
<StaticResource x:Key="TeachingTipTransientBackground" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<StaticResource x:Key="TeachingTipForegroundBrush" ResourceKey="TextFillColorPrimaryBrush"/>
<StaticResource x:Key="TeachingTipBackgroundBrush" ResourceKey="SystemControlPageBackgroundChromeLowBrush"/>
<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="TeachingTipAlternateCloseButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackgroundPointerOver" ResourceKey="SystemControlHighlightChromeHighBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackgroundPressed" ResourceKey="SystemControlHighlightChromeHighBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="TeachingTipAlternateCloseButtonForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<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 +67,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 +94,90 @@
<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="TeachingTipAlternateCloseButtonPadding">5</Thickness>
beervoley marked this conversation as resolved.
Show resolved Hide resolved
<x:String x:Key="TeachingTipAlternateCloseButtonGlyph">&#xE711;</x:String>

<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 TeachingTipAlternateCloseButtonBackground}" />
<Setter Property="Foreground" Value="{ThemeResource TeachingTipAlternateCloseButtonForeground}" />
<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="{ThemeResource TeachingTipAlternateCloseButtonPadding}"/>
<Setter Property="BorderThickness" Value="{ThemeResource TeachingTipAlternateCloseButtonBorderThickness}" />
<Setter Property="Content" Value="{ThemeResource TeachingTipAlternateCloseButtonGlyph}"/>
<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 TeachingTipAlternateCloseButtonBackgroundPointerOver}"/>
</ObjectAnimationUsingKeyFrames>
beervoley marked this conversation as resolved.
Show resolved Hide resolved
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TeachingTipAlternateCloseButtonForegroundPointerOver}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TeachingTipAlternateCloseButtonBackgroundPressed}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TeachingTipAlternateCloseButtonForegroundPressed}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TeachingTipAlternateCloseButtonBackgroundDisabled}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TeachingTipAlternateCloseButtonForegroundDisabled}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter"
AutomationProperties.AccessibilityView="Raw"
contract7Present:BackgroundSizing="{TemplateBinding BackgroundSizing}"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
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>