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

CommandBar updates #3993

Merged
merged 9 commits into from
Jan 27, 2021
3 changes: 2 additions & 1 deletion dev/CommonStyles/APITests/CommonStylesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public void CornerRadiusFilterConverterTest()
});
}

[TestMethod]
//Task 30789390: Re-enable disabled tests
//[TestMethod]
public void VerifyVisualTreeForControlsInCommonStyles()
{
var controlsToVerify = new List<string> {
Expand Down
194 changes: 89 additions & 105 deletions dev/CommonStyles/AppBarButton_themeresources.xaml

Large diffs are not rendered by default.

351 changes: 162 additions & 189 deletions dev/CommonStyles/AppBarToggleButton_themeresources.xaml

Large diffs are not rendered by default.

885 changes: 129 additions & 756 deletions dev/CommonStyles/CommandBar_themeresources.xaml

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions dev/CommonStyles/Common_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,8 @@
<SolidColorBrush x:Key="SystemFillColorNeutralBackgroundBrush" Color="{StaticResource SystemFillColorNeutralBackground}" />

<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="{StaticResource SolidBackgroundFillColorBase}" />

<StaticResource x:Key="DefaultTextForegroundThemeBrush" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="ApplicationPageBackgroundThemeBrush" ResourceKey="SolidBackgroundFillColorTertiaryBrush" />

<!-- Elevation border brushes-->

Expand Down Expand Up @@ -455,7 +454,6 @@
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="{StaticResource SolidBackgroundFillColorBase}" />

<StaticResource x:Key="DefaultTextForegroundThemeBrush" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="ApplicationPageBackgroundThemeBrush" ResourceKey="SolidBackgroundFillColorTertiaryBrush" />

<!-- Elevation border brushes-->

Expand Down Expand Up @@ -598,8 +596,9 @@
<SolidColorBrush x:Key="SystemFillColorCriticalBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="SystemFillColorNeutralBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" />

<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="{ThemeResource SystemColorWindowColor}" />

<StaticResource x:Key="DefaultTextForegroundThemeBrush" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="ApplicationPageBackgroundThemeBrush" ResourceKey="SolidBackgroundFillColorTertiaryBrush" />

<!-- Elevation border brushes-->

Expand Down
75 changes: 75 additions & 0 deletions dev/CommonStyles/TestUI/CommandBarPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<Page
x:Class="MUXControlsTestApp.CommandBarPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CommonStyles_TestUI"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract6Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,6)"
xmlns:contract6NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,6)"
xmlns:contract5NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,5)"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">


<Page.Resources>
</Page.Resources>

<Grid>
<StackPanel Orientation="Vertical">

<CommandBar>
<AppBarButton Icon="Add" Label="Add"/>
<AppBarButton Icon="Remove" Label="Remove"/>
<AppBarSeparator/>
<AppBarButton Icon="Save" Label="Save"/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
</CommandBar>

<CommandBar>
<AppBarButton Icon="Add" Label="Add"/>
<AppBarButton Icon="Remove" Label="Remove" LabelPosition="Collapsed"/>
<AppBarSeparator/>
<AppBarButton Icon="Save" Label="Save"/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
<CommandBar.SecondaryCommands>
<AppBarButton Icon="Add" Label="Add"/>
<AppBarButton Icon="Remove" Label="Remove"/>
<AppBarSeparator/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
</CommandBar.SecondaryCommands>
</CommandBar>

<CommandBar DefaultLabelPosition="Right">
<AppBarButton Icon="Add" Label="Add"/>
<AppBarButton Icon="Remove" Label="Remove"/>
<AppBarSeparator/>
<AppBarButton Icon="Save" Label="Save"/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
<CommandBar.SecondaryCommands>
<AppBarButton Icon="Add" Label="Add"/>
<AppBarButton Icon="Remove" Label="Remove"/>
<AppBarSeparator/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
</CommandBar.SecondaryCommands>
</CommandBar>

<CommandBar DefaultLabelPosition="Collapsed">
<AppBarButton Icon="Add" Label="Add"/>
<AppBarButton Icon="Remove" Label="Remove"/>
<AppBarSeparator/>
<AppBarButton Icon="Save" Label="Save"/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
<CommandBar.SecondaryCommands>
<AppBarButton Icon="Add" Label="Add"/>
<AppBarButton Icon="Remove" Label="Remove"/>
<AppBarSeparator/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
</CommandBar.SecondaryCommands>
</CommandBar>

</StackPanel>

</Grid>
</Page>
16 changes: 16 additions & 0 deletions dev/CommonStyles/TestUI/CommandBarPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Windows.UI.Xaml.Controls;

namespace MUXControlsTestApp
{
[TopLevelTestPage(Name = "CommandBar")]
public sealed partial class CommandBarPage : Page
{
public CommandBarPage()
{
this.InitializeComponent();
}
}
}
22 changes: 2 additions & 20 deletions dev/CommonStyles/TestUI/CommonStylesPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,7 @@ private void AppBarButtonDensityTest_Click(object sender, RoutedEventArgs e)
{
SimpleVerify simpleVerify = new SimpleVerify();
FrameworkElement[] iconCollapsedElements = { AppBarButton1, AppBarButton3 };
VerifyHeight(iconCollapsedElements, simpleVerify, 40);

// Bug 19741281: Density: AppBarButton/AppBarToggleButton Reveal style height is 60 other than 56 on RS1
// Bug 19767717: AppBarToggleButtonDensityTest fail on RS4
if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)
&& !PlatformConfiguration.IsOsVersion(OSVersion.Redstone4))
{
FrameworkElement[] iconVisibleElements = { AppBarButton2, AppBarButton4 };
VerifyHeight(iconVisibleElements, simpleVerify, 56);
}
VerifyHeight(iconCollapsedElements, simpleVerify, 48);

DensityTestResult.Text = simpleVerify.ToString();
}
Expand All @@ -288,16 +279,7 @@ private void AppBarToggleButtonDensityTest_Click(object sender, RoutedEventArgs
{
SimpleVerify simpleVerify = new SimpleVerify();
FrameworkElement[] iconCollapsedElements = { AppBarToggleButton1, AppBarToggleButton3 };
VerifyHeight(iconCollapsedElements, simpleVerify, 40);

// Bug 19741281: Density: AppBarButton/AppBarToggleButton Reveal style height is 60 other than 56 on RS1
// Bug 19767717: AppBarToggleButtonDensityTest fail on RS4
if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)
&& PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone4))
{
FrameworkElement[] iconVisibleElements = { AppBarToggleButton2, AppBarToggleButton4 };
VerifyHeight(iconVisibleElements, simpleVerify, 56);
}
VerifyHeight(iconCollapsedElements, simpleVerify, 48);

DensityTestResult.Text = simpleVerify.ToString();
}
Expand Down
8 changes: 8 additions & 0 deletions dev/CommonStyles/TestUI/CommonStyles_TestUI.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<Generator>MSBuild:Compile</Generator>
<IncludeInWindowsAppx>false</IncludeInWindowsAppx>
</Page>
<Page Include="$(MSBuildThisFileDirectory)CommandBarPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<IncludeInWindowsAppx>false</IncludeInWindowsAppx>
</Page>
<Page Include="$(MSBuildThisFileDirectory)CommonStylesPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand All @@ -40,6 +45,9 @@
<Compile Include="$(MSBuildThisFileDirectory)BorderThicknessPage.xaml.cs">
<DependentUpon>BorderThicknessPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)CommandBarPage.xaml.cs">
<DependentUpon>CommandBarPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)CommonStylesPage.xaml.cs">
<DependentUpon>CommonStylesPage.xaml</DependentUpon>
</Compile>
Expand Down
2 changes: 0 additions & 2 deletions dev/Materials/Reveal/RevealBrush_rs4_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1361,8 +1361,6 @@
</Setter>
</Style>

<Style TargetType="CommandBar" BasedOn="{StaticResource CommandBarRevealStyle}" />

<Style TargetType="ListViewItem" x:Key="ListViewItemRevealStyle">
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
Expand Down