Skip to content

Commit

Permalink
Syncing content from committish 131d0c2f503ffe84e7a3384d40815beeb49ef7c1
Browse files Browse the repository at this point in the history
  • Loading branch information
reunion-maestro-bot committed Jul 23, 2024
1 parent 66a7b0a commit 67723ef
Show file tree
Hide file tree
Showing 1,174 changed files with 19,421 additions and 15,546 deletions.
1 change: 1 addition & 0 deletions src/.vsconfig_buildtools
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"Microsoft.VisualStudio.ComponentGroup.UWP.VC.BuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
"Microsoft.VisualStudio.Workload.Universal",
"Microsoft.VisualStudio.Workload.UniversalBuildTools",
"Microsoft.VisualStudio.Workload.VCTools",
"Microsoft.VisualStudio.Component.VC.Runtimes.ARM64EC.Spectre",
Expand Down
2 changes: 2 additions & 0 deletions src/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@
<PackageReference Update="System.Private.Uri" Version="4.3.2"/>
<PackageReference Update="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)"/>
<PackageReference Update="Microsoft.WindowsAppSDK" Version="$(WindowsAppSdkPackageVersion)" />
<PackageReference Update="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Update="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/UpdateMockWinAppSDKPackage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<CallTarget Targets="Clean" />
<CallTarget Targets="Build" />
</Target>
<Target Name="Publish" />
<Target Name="Clean" Condition="'$(BuildingInsideVisualStudio)' == 'true'" />
<Target Name="Build" Condition="'$(BuildingInsideVisualStudio)' == 'true'" DependsOnTargets="CheckIfUpdateIsRequired" />
<Target Name="CheckIfUpdateIsRequired">
Expand Down
2 changes: 1 addition & 1 deletion src/controls/CleanupMSBuildProcesses.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(environment.props))" />
<Import Project="..\eng\versions.props" />
<Import Project="$(NuGetPackageRoot)\MUXCustomBuildTasks.$(MuxCustomBuildTasksPackageVersion)\build\MUXCustomBuildTasks.targets" Condition="Exists('$(NuGetPackageRoot)\MUXCustomBuildTasks\$(MuxCustomBuildTasksPackageVersion)\build\MUXCustomBuildTasks.targets')" />
<Import Project="$(NuGetPackageRoot)\MUXCustomBuildTasks.$(MuxCustomBuildTasksPackageVersion)\build\MUXCustomBuildTasks.targets" Condition="Exists('$(NuGetPackageRoot)\MUXCustomBuildTasks.$(MuxCustomBuildTasksPackageVersion)\build\MUXCustomBuildTasks.targets')" />
<Target Name="KillLeftOverMSBuildProcesses">
<ItemGroup>
<LeftOverMSBuildProcesses Include="$(TEMP)\*.msbproc" />
Expand Down
16 changes: 1 addition & 15 deletions src/controls/HybridCRT.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,7 @@
<UseCrtSDKReferenceStaticWarning>false</UseCrtSDKReferenceStaticWarning>
</PropertyGroup>

<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<!-- We use MultiThreadedDebug, rather than MultiThreadedDebugDLL, to avoid DLL dependencies on VCRUNTIME140d.dll and MSVCP140d.dll. -->
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<!-- Link statically against the runtime and STL, but link dynamically against the CRT by ignoring the static CRT
lib and instead linking against the Universal CRT DLL import library. This "hybrid" linking mechanism is
supported according to the CRT maintainer. Dynamic linking against the CRT makes the binaries a bit smaller
than they would otherwise be if the CRT, runtime, and STL were all statically linked in. -->
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries);libucrtd.lib</IgnoreSpecificDefaultLibraries>
<AdditionalOptions>%(AdditionalOptions) /defaultlib:ucrtd.lib</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ItemDefinitionGroup>
<ClCompile>
<!-- We use MultiThreaded, rather than MultiThreadedDLL, to avoid DLL dependencies on VCRUNTIME140.dll and MSVCP140.dll. -->
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
Expand Down
322 changes: 27 additions & 295 deletions src/controls/MUXControls.sln

Large diffs are not rendered by default.

269 changes: 0 additions & 269 deletions src/controls/MUXExperimental.sln

This file was deleted.

1 change: 1 addition & 0 deletions src/controls/ProjectImports.targets
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@
<Import Project="$(MSBuildThisFileDirectory)dev\AnnotatedScrollBar\AnnotatedScrollBar.vcxitems" Label="Shared" Condition="$(FeatureAnnotatedScrollBarEnabled) == 'true' Or $(FeatureAnnotatedScrollBarEnabled) == 'productOnly'" />
<Import Project="$(MSBuildThisFileDirectory)dev\MapControl\MapControl.vcxitems" Label="Shared" Condition="$(FeatureMapControlEnabled) == 'true' Or $(FeatureMapControlEnabled) == 'productOnly'" />
<Import Project="$(MSBuildThisFileDirectory)dev\SelectorBar\SelectorBar.vcxitems" Label="Shared" Condition="$(FeatureSelectorBarEnabled) == 'true' Or $(FeatureSelectorBarEnabled) == 'productOnly'" />
<Import Project="$(MSBuildThisFileDirectory)dev\TitleBar\TitleBar.vcxitems" Label="Shared" Condition="$(FeatureTitleBarEnabled) == 'true' Or $(FeatureTitleBarEnabled) == 'productOnly'" />
</ImportGroup>
</Project>
14 changes: 11 additions & 3 deletions src/controls/dev/AnimatedVisualPlayer/AnimatedVisualPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,17 @@ void AnimatedVisualPlayer::OnLoaded(winrt::IInspectable const& /*sender*/, winrt

void AnimatedVisualPlayer::OnUnloaded(winrt::IInspectable const& /*sender*/, winrt::RoutedEventArgs const& /*args*/)
{
m_isUnloaded = true;
// Remove any content. If we get reloaded the content will get reloaded.
UnloadContent();
// There is an anomaly in the Loading/Loaded/Unloaded events that can cause an Unloaded event to
// fire when the element is in the tree. When this happens, we end up unlaoding our content
// and not displaying it. Unfortunately, we can't fix this until at least version 2.0 so for
// for now we will work around it (as we have suggested to customers to do), by checking to see
// if we are actually unloaded before removing our content.
if (!IsLoaded())
{
m_isUnloaded = true;
// Remove any content. If we get reloaded the content will get reloaded.
UnloadContent();
}
}

void AnimatedVisualPlayer::OnHiding()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct AnimatedVisualPlayer :
//
tracker_ref<winrt::IAnimatedVisual> m_animatedVisual{ this };
// The native size of the current animated visual. Only valid if m_animatedVisual is not nullptr.
winrt::float2 m_animatedVisualSize;
winrt::float2 m_animatedVisualSize{};
winrt::Visual m_animatedVisualRoot{ nullptr };
int m_playAsyncVersion{ 0 };
double m_currentPlayFromProgress{ 0 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,11 @@ public void CollidingLabelsAreRemoved()
Verify.IsNotNull(label19);

Log.Comment("Some intermediate items not removed by collision logic should be visible.");
var label4 = ElementCache.TryGetObjectByName("Num 4", false);
Verify.IsNotNull(label4);
var label3 = ElementCache.TryGetObjectByName("Num 3", false);
Verify.IsNotNull(label3);

var label16 = ElementCache.TryGetObjectByName("Num 16", false);
Verify.IsNotNull(label16);
var label15 = ElementCache.TryGetObjectByName("Num 15", false);
Verify.IsNotNull(label15);

Log.Comment("Some intermediate items removed by collision logic should not be visible.");
var label1 = ElementCache.TryGetObjectByName("Num 1", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
</Grid.RowDefinitions>
<Border x:Name="BorderElement" Grid.Row="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" Grid.RowSpan="1" CornerRadius="{TemplateBinding CornerRadius}" />
<ContentPresenter x:Name="HeaderContentPresenter" x:DeferLoadStrategy="Lazy" Visibility="Collapsed" Grid.Row="0" Foreground="{ThemeResource TextControlHeaderForeground}" Margin="{ThemeResource AutoSuggestBoxTopHeaderMargin}" Grid.ColumnSpan="4" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontWeight="Normal" TextWrapping="Wrap" />
<ScrollViewer x:Name="ContentElement" Grid.Row="1" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" IsTabStop="False" AutomationProperties.AccessibilityView="Raw" ZoomMode="Disabled" />
<ScrollViewer x:Name="ContentElement" Foreground="{TemplateBinding Foreground}" Grid.Row="1" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" IsTabStop="False" AutomationProperties.AccessibilityView="Raw" ZoomMode="Disabled" />
<ContentControl x:Name="PlaceholderTextContentPresenter" Grid.Row="1" Foreground="{ThemeResource TextControlPlaceholderForeground}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" IsTabStop="False" Grid.ColumnSpan="2" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Content="{TemplateBinding PlaceholderText}" IsHitTestVisible="False" />
<Button x:Name="DeleteButton" Grid.Row="1" CornerRadius="{TemplateBinding CornerRadius}" Style="{StaticResource DeleteButtonStyle}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{ThemeResource HelperButtonThemePadding}" IsTabStop="False" Grid.Column="1" Visibility="Collapsed" FontSize="{TemplateBinding FontSize}" Width="32" AutomationProperties.AccessibilityView="Raw" VerticalAlignment="Stretch" />
<Button x:Name="QueryButton" Grid.Row="1" Grid.Column="2" CornerRadius="{TemplateBinding CornerRadius}" Style="{StaticResource QueryButtonStyle}" BorderThickness="{TemplateBinding BorderThickness}" Margin="2,0,0,0" Padding="{ThemeResource HelperButtonThemePadding}" IsTabStop="False" FontSize="{TemplateBinding FontSize}" Width="32" Height="28" VerticalAlignment="Stretch" AutomationProperties.AccessibilityView="Raw" />
Expand Down
15 changes: 7 additions & 8 deletions src/controls/dev/Breadcrumb/BreadcrumbBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Foreground="{TemplateBinding Foreground}"
Control.IsTemplateFocusTarget="True"
IsTabStop="False"
FocusVisualMargin="-3"
Padding="1,3"
CornerRadius="{TemplateBinding CornerRadius}">
Padding="1,3">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Foreground" Value="{ThemeResource BreadcrumbBarNormalForegroundBrush}" />
Expand All @@ -180,14 +181,10 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid Background="Transparent">
<Grid Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Target="PART_ContentPresenter.Foreground" Value="{ThemeResource BreadcrumbBarNormalForegroundBrush}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Normal" />
<!-- Current refers to the last item -->
<VisualState x:Name="CurrentNormal">
<VisualState.Setters>
Expand Down Expand Up @@ -250,6 +247,7 @@
Content="{TemplateBinding Content}"
ContentTransitions="{TemplateBinding ContentTransitions}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
Expand Down Expand Up @@ -287,6 +285,7 @@
<ContentPresenter x:Name="PART_LastItemContentPresenter"
AutomationProperties.AccessibilityView="Raw"
Visibility="Collapsed"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Content}"
ContentTransitions="{TemplateBinding ContentTransitions}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Expand Down
29 changes: 18 additions & 11 deletions src/controls/dev/Breadcrumb/InteractionTests/BreadcrumbBarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public static void ClassInitialize(TestContext testContext)
TestEnvironment.Initialize(testContext);
}

[TestCleanup]
public void TestCleanup()
{
TestCleanupHelper.Cleanup();
Expand Down Expand Up @@ -166,9 +167,9 @@ public void AddItemsAndCompressBreadcrumbTest()
using (var setup = new TestSetupHelper("BreadcrumbBar Tests"))
{
var breadcrumb = SetUpTest();

VerifyBreadcrumbBarItemsContain(breadcrumb.Children, new string[] { "Root", "Node A", "Node A_2", "Node A_2_3", "Node A_2_3_1" }, true);

Verify.AreEqual(1, breadcrumb.Children.Count, "The breadcrumb should contain 1 item");
}
}
Expand Down Expand Up @@ -248,7 +249,7 @@ public void InvokeDropDownItemTest()
[TestProperty("TestSuite", "A")]
public void KeyboardNavigationLeftToRightTest()
{
using (var setup = new TestSetupHelper("BreadcrumbBar Tests"))
using (var setup = new TestSetupHelper("BreadcrumbBar Tests", new TestSetupHelper.TestSetupHelperOptions { AutomaticCleanup = false }))
{
var breadcrumb = SetUpTest();
var breadcrumbItems = breadcrumb.Children;
Expand Down Expand Up @@ -287,14 +288,16 @@ public void KeyboardNavigationLeftToRightTest()
// Bug to solve here
KeyboardHelper.PressKey(Key.Left);
Verify.IsTrue(breadcrumbItems[0].HasKeyboardFocus, "'Root' BreadcrumbBarItem should keep the focus");

setup.AllowCleanup();
}
}

[TestMethod]
[TestProperty("TestSuite", "A")]
public void KeyboardNavigationRightToLeftTest()
{
using (var setup = new TestSetupHelper("BreadcrumbBar Tests"))
using (var setup = new TestSetupHelper("BreadcrumbBar Tests", new TestSetupHelper.TestSetupHelperOptions { AutomaticCleanup = false }))
{
var breadcrumb = SetUpTest();
var breadcrumbItems = breadcrumb.Children;
Expand Down Expand Up @@ -333,6 +336,8 @@ public void KeyboardNavigationRightToLeftTest()
// Bug to solve here
KeyboardHelper.PressKey(Key.Right);
Verify.IsTrue(breadcrumbItems[0].HasKeyboardFocus, "'Root' BreadcrumbBarItem should keep the focus");

setup.AllowCleanup();
}
}

Expand Down Expand Up @@ -453,7 +458,7 @@ public void KeyboardNavigationItemInvokationTest()
Verify.IsTrue(breadcrumbItems[2].HasKeyboardFocus, "'Node A_2' BreadcrumbBarItem should have focus");

KeyboardHelper.PressKey(Key.Enter);

VerifyLastClickedItemIndexIs(2);
VerifyLastClickedItemIs("Node A_2");

Expand All @@ -470,7 +475,7 @@ public void KeyboardNavigationItemInvokationTest()
[TestProperty("TestSuite", "A")]
public void KeyboardNavigationDropDownItemInvokationTest()
{
using(var setup = new TestSetupHelper("BreadcrumbBar Tests"))
using(var setup = new TestSetupHelper("BreadcrumbBar Tests", new TestSetupHelper.TestSetupHelperOptions { AutomaticCleanup = false }))
{
var breadcrumb = SetUpCrumbledTest();
var breadcrumbItems = breadcrumb.Children;
Expand Down Expand Up @@ -503,6 +508,8 @@ public void KeyboardNavigationDropDownItemInvokationTest()
Verify.AreEqual(2, breadcrumb.Children.Count, "The breadcrumb should contain 2 items.");

VerifyBreadcrumbBarItemsContain(breadcrumb.Children, new string[] { "Root", "Node A" });

setup.AllowCleanup();
}
}

Expand Down Expand Up @@ -688,7 +695,7 @@ private void SetFocusToFirstBreadcrumbBarItem(UIObject breadcrumb, bool isEllips

int indexToFocus = 0;

// The RS3 and RS2 behaviours seem a little odd on how many tabs need to be pressed
// The RS3 and RS2 behaviours seem a little odd on how many tabs need to be pressed
bool gotFocus = TryGetFocusForRs2(breadcrumb, indexToFocus, isEllipsisVisible);
if (!gotFocus)
{
Expand Down Expand Up @@ -763,14 +770,14 @@ private UIObject RetrieveRTLCheckBox(bool mustClickCheckBox = false)

private void VerifyBreadcrumbBarItemsContain(UICollection<UIObject> breadcrumbItems, string[] expectedItemValues, bool firstItemIsCurrentItem = false, bool isEllipsisVisible = false)
{
// WARNING: this method clicks on each breadcrumb so once the verification has finished,
// WARNING: this method clicks on each breadcrumb so once the verification has finished,
// only the ellipsis item and 'Root' should exist

// As recycled breadcrumbs are not deleted, then we compare that the breadcrumb count is always bigger
// As recycled breadcrumbs are not deleted, then we compare that the breadcrumb count is always bigger
// than the expected values count
var ellipsisPresentCount = isEllipsisVisible ? 1 : 0;

Verify.IsTrue(breadcrumbItems.Count - ellipsisPresentCount >= expectedItemValues.Length,
Verify.IsTrue(breadcrumbItems.Count - ellipsisPresentCount >= expectedItemValues.Length,
"The expected values count should at least be one less than the BreadcrumbBarItems count");

bool mustVerifyItemAsLastItem = firstItemIsCurrentItem;
Expand Down Expand Up @@ -813,7 +820,7 @@ private Button VerifyDropDownItemContainsText(string expectedText)
private Button GetDropDownItemByName(string dropDownItemName)
{
var ellipsisFlyout = FindElement.ByName("EllipsisFlyout");

foreach (var child in ellipsisFlyout.Children)
{
if (child.Name == dropDownItemName)
Expand Down
4 changes: 2 additions & 2 deletions src/controls/dev/ColorPicker/ColorHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ void CreateCheckeredBackgroundAsync(
return;
}

bgraCheckeredPixelData->reserve(static_cast<size_t>(width * height * 4));
bgraCheckeredPixelData->reserve(static_cast<size_t>(width) * height * 4);

winrt::WorkItemHandler workItemHandler(
[width, height, checkerColor, bgraCheckeredPixelData]
Expand Down Expand Up @@ -566,7 +566,7 @@ winrt::LoadedImageSurface CreateSurfaceFromPixelData(

for (int y = pixelHeight - 1; y >= 0; y--)
{
memcpy(bmpData.data() + (headerSize + (pixelHeight - 1 - y) * stride), (*bgraPixelData).data() + (y * stride), stride);
memcpy(bmpData.data() + (headerSize + (static_cast<size_t>(pixelHeight) - 1 - y) * stride), (*bgraPixelData).data() + (static_cast<size_t>(y) * stride), stride);
}

winrt::InMemoryRandomAccessStream stream = SharedHelpers::CreateStreamFromBytes(winrt::array_view<const byte>(bmpData));
Expand Down
Loading

0 comments on commit 67723ef

Please sign in to comment.