Skip to content

Commit 1d42e2d

Browse files
ismaelestalayomichael-hawker
authored andcommitted
updated InAppNotification style and template
1 parent efaaf1b commit 1d42e2d

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Core/InAppNotification/InAppNotification.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
<Style x:Key="BaseInAppNotificationsStyle"
1111
TargetType="local:InAppNotification">
12-
<Setter Property="Background" Value="{ThemeResource SystemControlChromeMediumLowAcrylicElementMediumBrush}" />
12+
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}" />
1313
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
14-
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseLowBrush}" />
14+
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlTransparentBrush}" />
1515
<Setter Property="Visibility" Value="Collapsed" />
16-
<Setter Property="BorderThickness" Value="2" />
16+
<Setter Property="BorderThickness" Value="0" />
1717
<Setter Property="HorizontalAlignment" Value="Stretch" />
1818
<Setter Property="VerticalAlignment" Value="Bottom" />
1919
<Setter Property="MinHeight" Value="55" />
20-
<Setter Property="FontSize" Value="16" />
20+
<Setter Property="FontSize" Value="14" />
2121
<Setter Property="RenderTransformOrigin" Value="0.5,1" />
2222
<Setter Property="Margin" Value="24,12" />
2323
<Setter Property="Padding" Value="24,12" />

Microsoft.Toolkit.Uwp.UI.Controls.Core/InAppNotification/Styles/MSEdgeNotificationStyle.xaml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
</ResourceDictionary>
3232
</ResourceDictionary.ThemeDictionaries>
3333

34-
<x:Double x:Key="SystemControlMSEdgeNotificationDismissButtonSize">40</x:Double>
3534
<Thickness x:Key="SystemControlMSEdgeNotificationDismissButtonMargin">24,0,0,0</Thickness>
35+
<x:Double x:Key="SystemControlMSEdgeNotificationDismissButtonSize">32</x:Double>
3636
<x:Double x:Key="SystemControlMSEdgeNotificationDismissButtonTranslate">18</x:Double>
37-
<VerticalAlignment x:Key="SystemControlMSEdgeNotificationDismissButtonVerticalAlignment">Center</VerticalAlignment>
37+
<VerticalAlignment x:Key="SystemControlMSEdgeNotificationDismissButtonVerticalAlignment">Top</VerticalAlignment>
3838
<Thickness x:Key="SystemControlMSEdgeNotificationButtonBorderThickness">2</Thickness>
3939

4040
<Style x:Key="DismissTextBlockButtonStyle"
@@ -48,9 +48,10 @@
4848
<Setter Property="Template">
4949
<Setter.Value>
5050
<ControlTemplate TargetType="ButtonBase">
51-
<Grid x:Name="RootGrid"
52-
Margin="{TemplateBinding Padding}"
53-
Background="{TemplateBinding Background}">
51+
<Grid x:Name="RootGrid" CornerRadius="2" Background="{ThemeResource ButtonPointerOverBackgroundThemeBrush}"
52+
Margin="{TemplateBinding Margin}"
53+
Height="{StaticResource SystemControlMSEdgeNotificationDismissButtonSize}"
54+
Width="{StaticResource SystemControlMSEdgeNotificationDismissButtonSize}">
5455
<Border x:Name="TextBorder"
5556
BorderThickness="{StaticResource SystemControlMSEdgeNotificationButtonBorderThickness}"
5657
BorderBrush="{ThemeResource SystemControlMSEdgeNotificationButtonBorderBrush}">
@@ -65,15 +66,10 @@
6566
<VisualState x:Name="Normal" />
6667
<VisualState x:Name="PointerOver">
6768
<Storyboard>
68-
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text"
69-
Storyboard.TargetProperty="Foreground">
70-
<DiscreteObjectKeyFrame KeyTime="0"
71-
Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverForegroundBrush}" />
72-
</ObjectAnimationUsingKeyFrames>
7369
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
7470
Storyboard.TargetProperty="Background">
7571
<DiscreteObjectKeyFrame KeyTime="0"
76-
Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverChromeBrush}" />
72+
Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />
7773
</ObjectAnimationUsingKeyFrames>
7874
</Storyboard>
7975
</VisualState>
@@ -145,20 +141,21 @@
145141
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
146142
HorizontalContentAlignment="Stretch"
147143
VerticalContentAlignment="Center"
144+
FontWeight="SemiBold"
148145
ContentTransitions="{TemplateBinding ContentTransitions}"
149-
TextWrapping="WrapWholeWords" />
146+
TextWrapping="Wrap" />
150147

151148
<Button x:Name="PART_DismissButton"
152149
Grid.Column="1"
153-
Margin="{StaticResource SystemControlMSEdgeNotificationDismissButtonMargin}"
150+
Margin="0" Width="auto"
154151
AutomationProperties.Name="Dismiss"
155152
Content="&#xE894;"
156153
FontFamily="Segoe MDL2 Assets"
157-
FontSize="16"
154+
FontSize="12"
158155
VerticalAlignment="{StaticResource SystemControlMSEdgeNotificationDismissButtonVerticalAlignment}"
159156
Style="{StaticResource DismissTextBlockButtonStyle}">
160157
<Button.RenderTransform>
161-
<TranslateTransform x:Name="DismissButtonTransform" X="18" />
158+
<TranslateTransform x:Name="DismissButtonTransform" X="18" Y="-8"/>
162159
</Button.RenderTransform>
163160
</Button>
164161
</Grid>

0 commit comments

Comments
 (0)