From d5e6a007a34cbfb8d2c331a8033106bb443fb4e7 Mon Sep 17 00:00:00 2001 From: Learner Date: Wed, 31 Mar 2021 12:02:37 -0700 Subject: [PATCH] InkToolbar Style updates (#4507) * Style updates * Style updates * Updated Buttons Width and Height * Style updates: Added Margin to buttons, removed pill, added chevron back * Flyout style updates * Remove unused InkToolbarFlyoutL3PreviewPen Color * Fixed Color and Size of chevron * Improved margin, changed the chevron color * Added flyout item pill hover color * Margin changes * Margin changes * Changed the size from 40 px to 36 px * Added Contract7Present for CornerRadius * Removed stray spaces * Added word Foreground to Accent colors * Removed commented margin * Removed InkToolbarSelectionAccentStyle and it's references * Merged two visual state groups to one * Changed RadiusX from 8 to 1.5 * Added vertical inkToolbar test * Added vertical support and opening flyout tests * Removed unused code * Changed CurrentSelectionIcon.Opacity to 0 from 1 in disabled state * Removed unused code * Removed ambiguous test * Updated InkToolbarButtonContentSize to InkToolbarButtonFontSize * Using StaticResource instead of ThemeResource * Added open flyout test and vertical inktoolbar test * Added contract7Present API before CornerRadius * Removed ShowExtensionGlyph visualStateGroups * Margin updates * Corrected Typos in InkToolbarButtonSelectedBackgroundPointerOver Resource key Co-authored-by: Vivek Sharma --- .../InkToolbar_themeresources.xaml | 1092 +++++++++-------- .../InteractionTests/CommonStylesTests.cs | 8 + dev/CommonStyles/TestUI/InkToolbarPage.xaml | 18 +- 3 files changed, 574 insertions(+), 544 deletions(-) diff --git a/dev/CommonStyles/InkToolbar_themeresources.xaml b/dev/CommonStyles/InkToolbar_themeresources.xaml index b4d780f7b7..beda6a1b17 100644 --- a/dev/CommonStyles/InkToolbar_themeresources.xaml +++ b/dev/CommonStyles/InkToolbar_themeresources.xaml @@ -1,114 +1,115 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> - - - 16 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - 1 - - - - + 0 + + + + + + + + + + + + + - - - 16 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - 1 - - - - + 0 + + + + + + + + + + + + + - - - 16 - - - - @@ -117,11 +118,11 @@ - + + - @@ -131,24 +132,43 @@ + + + + + + + + 1 + + + + + 36 + 36 + 16 + 0,1,0,1 + 12,0,12,0 + 0,0,12,0 + - + + - + @@ -1112,13 +1180,13 @@ Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" - Margin="12,0,12,0"/> + Margin="{StaticResource InkToolbarFlyoutItemIconMargin}"/> + Margin="{StaticResource InkToolbarFlyoutItemTextBlockMargin}"/> @@ -1140,13 +1208,13 @@ Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" - Margin="12,0,12,0"/> + Margin="{StaticResource InkToolbarFlyoutItemIconMargin}"/> + Margin="{StaticResource InkToolbarFlyoutItemTextBlockMargin}"/> @@ -1168,13 +1236,13 @@ Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" - Margin="12,0,12,0"/> + Margin="{StaticResource InkToolbarFlyoutItemIconMargin}"/> + Margin="{StaticResource InkToolbarFlyoutItemTextBlockMargin}"/> @@ -1196,13 +1264,13 @@ Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" - Margin="12,0,12,0"/> + Margin="{StaticResource InkToolbarFlyoutItemIconMargin}"/> + Margin="{StaticResource InkToolbarFlyoutItemTextBlockMargin}"/> @@ -1217,8 +1285,9 @@ + Width="{StaticResource InkToolbarButtonWidth}" + Height="{StaticResource InkToolbarButtonHeight}" + contract7Present:CornerRadius="{TemplateBinding CornerRadius}"> @@ -1226,23 +1295,21 @@ - - + - - + @@ -1252,39 +1319,64 @@ - + - - - - - + + + + + - + - - - - - + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + - + @@ -1298,7 +1390,6 @@ - @@ -1307,10 +1398,6 @@ - - - - @@ -1319,10 +1406,6 @@ - - - - @@ -1331,10 +1414,6 @@ - - - - @@ -1343,10 +1422,6 @@ - - - - @@ -1370,7 +1445,7 @@ Text="" AutomationProperties.AccessibilityView="Raw" Canvas.ZIndex="1" - Foreground="{ThemeResource InkToolbarButtonForegroundThemeBrush}" /> + Foreground="{ThemeResource InkToolbarButtonForeground}" /> + Margin="1,0" + contract7Present:CornerRadius="{TemplateBinding CornerRadius}"/> - @@ -1406,8 +1481,8 @@ + Width="{StaticResource InkToolbarButtonWidth}" + Height="{StaticResource InkToolbarButtonHeight}"> @@ -1415,21 +1490,19 @@ - - + - - + @@ -1438,37 +1511,12 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1478,7 +1526,6 @@ - @@ -1487,10 +1534,6 @@ - - - - @@ -1499,10 +1542,6 @@ - - - - @@ -1511,10 +1550,6 @@ - - - - @@ -1523,10 +1558,6 @@ - - - - @@ -1550,8 +1581,8 @@ BorderThickness="{TemplateBinding BorderThickness}" Grid.RowSpan="2" Grid.ColumnSpan="2" - Margin="1,0"/> - + Margin="1,0" + contract7Present:CornerRadius="{TemplateBinding CornerRadius}"/> @@ -1559,7 +1590,7 @@ - + - + - + - + @@ -1801,13 +1821,13 @@ Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" - Margin="12,0,12,0"/> + Margin="{StaticResource InkToolbarFlyoutItemIconMargin}"/> + Margin="{StaticResource InkToolbarFlyoutItemTextBlockMargin}"/> @@ -1828,13 +1848,13 @@ Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" - Margin="12,0,12,0"/> + Margin="{StaticResource InkToolbarFlyoutItemIconMargin}"/> + Margin="{StaticResource InkToolbarFlyoutItemTextBlockMargin}"/> @@ -1850,8 +1870,9 @@ + Width="{StaticResource InkToolbarButtonWidth}" + Height="{StaticResource InkToolbarButtonHeight}" + contract7Present:CornerRadius="{TemplateBinding CornerRadius}"> @@ -1859,23 +1880,21 @@ - - + - - + @@ -1885,61 +1904,72 @@ - + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + - - - - - - - - - - - - - - - - + - + @@ -1953,7 +1983,6 @@ - @@ -1962,10 +1991,6 @@ - - - - @@ -1974,10 +1999,6 @@ - - - - @@ -1986,10 +2007,6 @@ - - - - @@ -1998,10 +2015,6 @@ - - - - @@ -2025,7 +2038,7 @@ Text="" AutomationProperties.AccessibilityView="Raw" Canvas.ZIndex="1" - Foreground="{ThemeResource InkToolbarButtonForegroundThemeBrush}" /> + Foreground="{ThemeResource InkToolbarButtonForeground}" /> + Margin="1,0" + contract7Present:CornerRadius="{TemplateBinding CornerRadius}"/> - @@ -2058,8 +2071,8 @@ Orientation="Horizontal" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" /> - + BorderThickness="{TemplateBinding BorderThickness}" + Margin="2,2,2,2"/> @@ -2100,7 +2113,7 @@ Grid.Row="1" Grid.Column="0" Padding="12,0,12,0" - Style="{ThemeResource BodyTextBlockStyle}" + Style="{ThemeResource InkToolbarPenConfigurationControlTextStyle}" HighContrastAdjustment="None" Text="Colors" /> @@ -2204,7 +2217,7 @@ Grid.Column="0" Padding="12,0,12,0" VerticalAlignment="Center" - Style="{ThemeResource BodyTextBlockStyle}" + Style="{ThemeResource InkToolbarPenConfigurationControlTextStyle}" Text="Size" HighContrastAdjustment="None" /> + Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PenButton.SelectedStrokeWidth, Mode=TwoWay}"/> diff --git a/dev/CommonStyles/InteractionTests/CommonStylesTests.cs b/dev/CommonStyles/InteractionTests/CommonStylesTests.cs index 0d89867432..f1abe51e64 100644 --- a/dev/CommonStyles/InteractionTests/CommonStylesTests.cs +++ b/dev/CommonStyles/InteractionTests/CommonStylesTests.cs @@ -158,6 +158,14 @@ public void InkToolbarTest() { var textBlock = FindElement.ByName("InkToolbar"); Verify.IsNotNull(textBlock, "Verify InkToolbar page doesn't crash"); + + var verticalInkToolbar = FindElement.ById("VerticalInkToolbar"); + Verify.IsNotNull(textBlock, "Verify verticalInkToolbar doesn't crash"); + + Log.Comment("Click on " + "InkToolbarBallpointPenButton"); + var radioButton = new RadioButton(FindElement.ById("InkToolbarBallpointPenButton")); + radioButton.Select(); + Wait.ForIdle(); } } } diff --git a/dev/CommonStyles/TestUI/InkToolbarPage.xaml b/dev/CommonStyles/TestUI/InkToolbarPage.xaml index 88103c142a..190828404d 100644 --- a/dev/CommonStyles/TestUI/InkToolbarPage.xaml +++ b/dev/CommonStyles/TestUI/InkToolbarPage.xaml @@ -4,8 +4,18 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - - - - + + + + + + + + + + +