Skip to content

Commit

Permalink
Adding system inktoolbar styles to winui (#4467)
Browse files Browse the repository at this point in the history
* Added InkToolbar

* Added InkToolbar Changes

* Updated as per latest guidance

* Round Corner changes and Removed reveal

* Style updates

* Removed SelectionAccent(underline)

* Round Corner of Color Flyout

* Slider style updates

* Replaced Reveal Effects with winui ones

* Shorten the selection accent and added cornerRadius to button borders

* Formatting

* Fixed Ruler and Protractor display and made round corner of selectionAccent

* Replaced colors from Figma

* Style updates

* Decreased the margin for highlighter button flyout

* Formatting

* Added InkToolbar os version

* Included the license header

* Moved Comment location for flyout

* Swapped Light and High Contrast Resource Dictionaries

* Formatting

* Added code to write on Ink Canvas

Co-authored-by: Vivek Sharma <[email protected]>
Co-authored-by: Ranjesh <[email protected]>
  • Loading branch information
3 people authored Mar 11, 2021
1 parent adbd854 commit 20d6fd8
Show file tree
Hide file tree
Showing 6 changed files with 2,294 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dev/CommonStyles/CommonStyles.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
<Version>RS1</Version>
<Type>ThemeResources</Type>
</Page>
<Page Include="$(MSBuildThisFileDirectory)InkToolbar_themeresources.xaml" >
<ControlsResourcesVersion>Version2</ControlsResourcesVersion>
<Version>RS1</Version>
<Type>ThemeResources</Type>
</Page>
<Page Include="$(MSBuildThisFileDirectory)RadioButton_themeresources.xaml">
<ControlsResourcesVersion>Version2</ControlsResourcesVersion>
<Version>RS1</Version>
Expand Down
2,237 changes: 2,237 additions & 0 deletions dev/CommonStyles/InkToolbar_themeresources.xaml

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions dev/CommonStyles/InteractionTests/CommonStylesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,15 @@ public void CornerRadiusTest()
Verify.IsNotNull(textBlock, "Verify corner radius page doesn't crash");
}
}

[TestMethod]
public void InkToolbarTest()
{
using (var setup = new TestSetupHelper("InkToolbar Tests"))
{
var textBlock = FindElement.ByName("InkToolbar");
Verify.IsNotNull(textBlock, "Verify InkToolbar page doesn't crash");
}
}
}
}
8 changes: 8 additions & 0 deletions dev/CommonStyles/TestUI/CommonStyles_TestUI.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
<Generator>MSBuild:Compile</Generator>
<IncludeInWindowsAppx>false</IncludeInWindowsAppx>
</Page>
<Page Include="$(MSBuildThisFileDirectory)InkToolbarPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<IncludeInWindowsAppx>false</IncludeInWindowsAppx>
</Page>
<Page Include="$(MSBuildThisFileDirectory)TextControlsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -108,6 +113,9 @@
<Compile Include="$(MSBuildThisFileDirectory)CornerRadiusPage.xaml.cs">
<DependentUpon>CornerRadiusPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)InkToolbarPage.xaml.cs">
<DependentUpon>InkToolbarPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)TextControlsPage.xaml.cs">
<DependentUpon>TextControlsPage.xaml</DependentUpon>
</Compile>
Expand Down
11 changes: 11 additions & 0 deletions dev/CommonStyles/TestUI/InkToolbarPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<Page
x:Class="MUXControlsTestApp.InkToolbarPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel>
<InkToolbar TargetInkCanvas="{x:Bind inkCanvas}"/>
<InkCanvas x:Name="inkCanvas" Height="400"/>
</StackPanel>
</Page>
23 changes: 23 additions & 0 deletions dev/CommonStyles/TestUI/InkToolbarPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Windows.UI.Core;
using Windows.UI.Input.Inking;
using Windows.UI.Xaml.Controls;

namespace MUXControlsTestApp
{
[TopLevelTestPage(Name = "InkToolbar")]
public sealed partial class InkToolbarPage : Page
{
private InkPresenter _inkPresenter;

public InkToolbarPage()
{
this.InitializeComponent();
_inkPresenter = inkCanvas.InkPresenter;
_inkPresenter.InputDeviceTypes =
CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Touch;
}
}
}

0 comments on commit 20d6fd8

Please sign in to comment.