diff --git a/dev/Generated/TeachingTip.properties.cpp b/dev/Generated/TeachingTip.properties.cpp index 06daf7e659..420bd2ba20 100644 --- a/dev/Generated/TeachingTip.properties.cpp +++ b/dev/Generated/TeachingTip.properties.cpp @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. // DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen @@ -21,11 +21,11 @@ GlobalDependencyProperty TeachingTipProperties::s_HeroContentPlacementProperty{ GlobalDependencyProperty TeachingTipProperties::s_IconSourceProperty{ nullptr }; GlobalDependencyProperty TeachingTipProperties::s_IsLightDismissEnabledProperty{ nullptr }; GlobalDependencyProperty TeachingTipProperties::s_IsOpenProperty{ nullptr }; -GlobalDependencyProperty TeachingTipProperties::s_PointerModeProperty{ nullptr }; +GlobalDependencyProperty TeachingTipProperties::s_PlacementMarginProperty{ nullptr }; GlobalDependencyProperty TeachingTipProperties::s_PreferredPlacementProperty{ nullptr }; GlobalDependencyProperty TeachingTipProperties::s_SubtitleProperty{ nullptr }; +GlobalDependencyProperty TeachingTipProperties::s_TailVisibilityProperty{ nullptr }; GlobalDependencyProperty TeachingTipProperties::s_TargetProperty{ nullptr }; -GlobalDependencyProperty TeachingTipProperties::s_TargetOffsetProperty{ nullptr }; GlobalDependencyProperty TeachingTipProperties::s_TemplateSettingsProperty{ nullptr }; GlobalDependencyProperty TeachingTipProperties::s_TitleProperty{ nullptr }; @@ -183,16 +183,16 @@ void TeachingTipProperties::EnsureProperties() ValueHelper::BoxValueIfNecessary(false), winrt::PropertyChangedCallback(&OnIsOpenPropertyChanged)); } - if (!s_PointerModeProperty) + if (!s_PlacementMarginProperty) { - s_PointerModeProperty = + s_PlacementMarginProperty = InitializeDependencyProperty( - L"PointerMode", - winrt::name_of(), + L"PlacementMargin", + winrt::name_of(), winrt::name_of(), false /* isAttached */, - ValueHelper::BoxValueIfNecessary(winrt::TeachingTipPointerMode::Auto), - winrt::PropertyChangedCallback(&OnPointerModePropertyChanged)); + ValueHelper::BoxedDefaultValue(), + winrt::PropertyChangedCallback(&OnPlacementMarginPropertyChanged)); } if (!s_PreferredPlacementProperty) { @@ -216,6 +216,17 @@ void TeachingTipProperties::EnsureProperties() ValueHelper::BoxedDefaultValue(), winrt::PropertyChangedCallback(&OnSubtitlePropertyChanged)); } + if (!s_TailVisibilityProperty) + { + s_TailVisibilityProperty = + InitializeDependencyProperty( + L"TailVisibility", + winrt::name_of(), + winrt::name_of(), + false /* isAttached */, + ValueHelper::BoxValueIfNecessary(winrt::TeachingTipTailVisibility::Auto), + winrt::PropertyChangedCallback(&OnTailVisibilityPropertyChanged)); + } if (!s_TargetProperty) { s_TargetProperty = @@ -227,17 +238,6 @@ void TeachingTipProperties::EnsureProperties() ValueHelper::BoxedDefaultValue(), winrt::PropertyChangedCallback(&OnTargetPropertyChanged)); } - if (!s_TargetOffsetProperty) - { - s_TargetOffsetProperty = - InitializeDependencyProperty( - L"TargetOffset", - winrt::name_of(), - winrt::name_of(), - false /* isAttached */, - ValueHelper::BoxedDefaultValue(), - winrt::PropertyChangedCallback(&OnTargetOffsetPropertyChanged)); - } if (!s_TemplateSettingsProperty) { s_TemplateSettingsProperty = @@ -277,11 +277,11 @@ void TeachingTipProperties::ClearProperties() s_IconSourceProperty = nullptr; s_IsLightDismissEnabledProperty = nullptr; s_IsOpenProperty = nullptr; - s_PointerModeProperty = nullptr; + s_PlacementMarginProperty = nullptr; s_PreferredPlacementProperty = nullptr; s_SubtitleProperty = nullptr; + s_TailVisibilityProperty = nullptr; s_TargetProperty = nullptr; - s_TargetOffsetProperty = nullptr; s_TemplateSettingsProperty = nullptr; s_TitleProperty = nullptr; } @@ -390,7 +390,7 @@ void TeachingTipProperties::OnIsOpenPropertyChanged( winrt::get_self(owner)->OnPropertyChanged(args); } -void TeachingTipProperties::OnPointerModePropertyChanged( +void TeachingTipProperties::OnPlacementMarginPropertyChanged( winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args) { @@ -414,7 +414,7 @@ void TeachingTipProperties::OnSubtitlePropertyChanged( winrt::get_self(owner)->OnPropertyChanged(args); } -void TeachingTipProperties::OnTargetPropertyChanged( +void TeachingTipProperties::OnTailVisibilityPropertyChanged( winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args) { @@ -422,7 +422,7 @@ void TeachingTipProperties::OnTargetPropertyChanged( winrt::get_self(owner)->OnPropertyChanged(args); } -void TeachingTipProperties::OnTargetOffsetPropertyChanged( +void TeachingTipProperties::OnTargetPropertyChanged( winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args) { @@ -576,14 +576,14 @@ bool TeachingTipProperties::IsOpen() return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_IsOpenProperty)); } -void TeachingTipProperties::PointerMode(winrt::TeachingTipPointerMode const& value) +void TeachingTipProperties::PlacementMargin(winrt::Thickness const& value) { - static_cast(this)->SetValue(s_PointerModeProperty, ValueHelper::BoxValueIfNecessary(value)); + static_cast(this)->SetValue(s_PlacementMarginProperty, ValueHelper::BoxValueIfNecessary(value)); } -winrt::TeachingTipPointerMode TeachingTipProperties::PointerMode() +winrt::Thickness TeachingTipProperties::PlacementMargin() { - return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_PointerModeProperty)); + return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_PlacementMarginProperty)); } void TeachingTipProperties::PreferredPlacement(winrt::TeachingTipPlacementMode const& value) @@ -606,24 +606,24 @@ winrt::hstring TeachingTipProperties::Subtitle() return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_SubtitleProperty)); } -void TeachingTipProperties::Target(winrt::FrameworkElement const& value) +void TeachingTipProperties::TailVisibility(winrt::TeachingTipTailVisibility const& value) { - static_cast(this)->SetValue(s_TargetProperty, ValueHelper::BoxValueIfNecessary(value)); + static_cast(this)->SetValue(s_TailVisibilityProperty, ValueHelper::BoxValueIfNecessary(value)); } -winrt::FrameworkElement TeachingTipProperties::Target() +winrt::TeachingTipTailVisibility TeachingTipProperties::TailVisibility() { - return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_TargetProperty)); + return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_TailVisibilityProperty)); } -void TeachingTipProperties::TargetOffset(winrt::Thickness const& value) +void TeachingTipProperties::Target(winrt::FrameworkElement const& value) { - static_cast(this)->SetValue(s_TargetOffsetProperty, ValueHelper::BoxValueIfNecessary(value)); + static_cast(this)->SetValue(s_TargetProperty, ValueHelper::BoxValueIfNecessary(value)); } -winrt::Thickness TeachingTipProperties::TargetOffset() +winrt::FrameworkElement TeachingTipProperties::Target() { - return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_TargetOffsetProperty)); + return ValueHelper::CastOrUnbox(static_cast(this)->GetValue(s_TargetProperty)); } void TeachingTipProperties::TemplateSettings(winrt::TeachingTipTemplateSettings const& value) diff --git a/dev/Generated/TeachingTip.properties.h b/dev/Generated/TeachingTip.properties.h index e2ca0ba081..1a7995dfae 100644 --- a/dev/Generated/TeachingTip.properties.h +++ b/dev/Generated/TeachingTip.properties.h @@ -48,8 +48,8 @@ class TeachingTipProperties void IsOpen(bool value); bool IsOpen(); - void PointerMode(winrt::TeachingTipPointerMode const& value); - winrt::TeachingTipPointerMode PointerMode(); + void PlacementMargin(winrt::Thickness const& value); + winrt::Thickness PlacementMargin(); void PreferredPlacement(winrt::TeachingTipPlacementMode const& value); winrt::TeachingTipPlacementMode PreferredPlacement(); @@ -57,12 +57,12 @@ class TeachingTipProperties void Subtitle(winrt::hstring const& value); winrt::hstring Subtitle(); + void TailVisibility(winrt::TeachingTipTailVisibility const& value); + winrt::TeachingTipTailVisibility TailVisibility(); + void Target(winrt::FrameworkElement const& value); winrt::FrameworkElement Target(); - void TargetOffset(winrt::Thickness const& value); - winrt::Thickness TargetOffset(); - void TemplateSettings(winrt::TeachingTipTemplateSettings const& value); winrt::TeachingTipTemplateSettings TemplateSettings(); @@ -82,11 +82,11 @@ class TeachingTipProperties static winrt::DependencyProperty IconSourceProperty() { return s_IconSourceProperty; } static winrt::DependencyProperty IsLightDismissEnabledProperty() { return s_IsLightDismissEnabledProperty; } static winrt::DependencyProperty IsOpenProperty() { return s_IsOpenProperty; } - static winrt::DependencyProperty PointerModeProperty() { return s_PointerModeProperty; } + static winrt::DependencyProperty PlacementMarginProperty() { return s_PlacementMarginProperty; } static winrt::DependencyProperty PreferredPlacementProperty() { return s_PreferredPlacementProperty; } static winrt::DependencyProperty SubtitleProperty() { return s_SubtitleProperty; } + static winrt::DependencyProperty TailVisibilityProperty() { return s_TailVisibilityProperty; } static winrt::DependencyProperty TargetProperty() { return s_TargetProperty; } - static winrt::DependencyProperty TargetOffsetProperty() { return s_TargetOffsetProperty; } static winrt::DependencyProperty TemplateSettingsProperty() { return s_TemplateSettingsProperty; } static winrt::DependencyProperty TitleProperty() { return s_TitleProperty; } @@ -103,11 +103,11 @@ class TeachingTipProperties static GlobalDependencyProperty s_IconSourceProperty; static GlobalDependencyProperty s_IsLightDismissEnabledProperty; static GlobalDependencyProperty s_IsOpenProperty; - static GlobalDependencyProperty s_PointerModeProperty; + static GlobalDependencyProperty s_PlacementMarginProperty; static GlobalDependencyProperty s_PreferredPlacementProperty; static GlobalDependencyProperty s_SubtitleProperty; + static GlobalDependencyProperty s_TailVisibilityProperty; static GlobalDependencyProperty s_TargetProperty; - static GlobalDependencyProperty s_TargetOffsetProperty; static GlobalDependencyProperty s_TemplateSettingsProperty; static GlobalDependencyProperty s_TitleProperty; @@ -180,7 +180,7 @@ class TeachingTipProperties winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args); - static void OnPointerModePropertyChanged( + static void OnPlacementMarginPropertyChanged( winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args); @@ -192,11 +192,11 @@ class TeachingTipProperties winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args); - static void OnTargetPropertyChanged( + static void OnTailVisibilityPropertyChanged( winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args); - static void OnTargetOffsetPropertyChanged( + static void OnTargetPropertyChanged( winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args); diff --git a/dev/TeachingTip/TeachingTip.cpp b/dev/TeachingTip/TeachingTip.cpp index c3ec1ad10a..df821d2608 100644 --- a/dev/TeachingTip/TeachingTip.cpp +++ b/dev/TeachingTip/TeachingTip.cpp @@ -33,7 +33,7 @@ void TeachingTip::OnApplyTemplate() m_container.set(GetTemplateChildT(s_containerName, controlProtected)); m_rootElement.set(m_container.get().Child()); - m_pointerOcclusionGrid.set(GetTemplateChildT(s_pointerOcclusionGridName, controlProtected)); + m_tailOcclusionGrid.set(GetTemplateChildT(s_tailOcclusionGridName, controlProtected)); m_contentRootGrid.set(GetTemplateChildT(s_contentRootGridName, controlProtected)); m_nonHeroContentRootGrid.set(GetTemplateChildT(s_nonHeroContentRootGridName, controlProtected)); m_heroContentBorder.set(GetTemplateChildT(s_heroContentBorderName, controlProtected)); @@ -41,21 +41,21 @@ void TeachingTip::OnApplyTemplate() m_actionButton.set(GetTemplateChildT(s_actionButtonName, controlProtected)); m_alternateCloseButton.set(GetTemplateChildT(s_alternateCloseButtonName, controlProtected)); m_closeButton.set(GetTemplateChildT(s_closeButtonName, controlProtected)); - m_pointerEdgeBorder.set(GetTemplateChildT(s_pointerEdgeBorderName, controlProtected)); - m_pointerPolygon.set(GetTemplateChildT(s_pointerPolygonName, controlProtected)); + m_tailEdgeBorder.set(GetTemplateChildT(s_tailEdgeBorderName, controlProtected)); + m_tailPolygon.set(GetTemplateChildT(s_tailPolygonName, controlProtected)); if (auto && container = m_container.get()) { container.Child(nullptr); } - if (auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get()) + if (auto&& tailOcclusionGrid = m_tailOcclusionGrid.get()) { - m_contentSizeChangedRevoker = pointerOcclusionGrid.SizeChanged(winrt::auto_revoke, { + m_contentSizeChangedRevoker = tailOcclusionGrid.SizeChanged(winrt::auto_revoke, { [this](auto const&, auto const&) { UpdateSizeBasedTemplateSettings(); - // Reset the currentEffectivePlacementMode so that the pointer will be updated for the new size as well. + // Reset the currentEffectivePlacementMode so that the tail will be updated for the new size as well. m_currentEffectiveTipPlacementMode = winrt::TeachingTipPlacementMode::Auto; TeachingTipTestHooks::NotifyEffectivePlacementChanged(*this); if (IsOpen()) @@ -63,16 +63,16 @@ void TeachingTip::OnApplyTemplate() PositionPopup(); } { - auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get(); + auto&& tailOcclusionGrid = m_tailOcclusionGrid.get(); if (auto&& expandAnimation = m_expandAnimation.get()) { - expandAnimation.SetScalarParameter(L"Width", static_cast(pointerOcclusionGrid.ActualWidth())); - expandAnimation.SetScalarParameter(L"Height", static_cast(pointerOcclusionGrid.ActualHeight())); + expandAnimation.SetScalarParameter(L"Width", static_cast(tailOcclusionGrid.ActualWidth())); + expandAnimation.SetScalarParameter(L"Height", static_cast(tailOcclusionGrid.ActualHeight())); } if (auto&& contractAnimation = m_contractAnimation.get()) { - contractAnimation.SetScalarParameter(L"Width", static_cast(pointerOcclusionGrid.ActualWidth())); - contractAnimation.SetScalarParameter(L"Height", static_cast(pointerOcclusionGrid.ActualHeight())); + contractAnimation.SetScalarParameter(L"Width", static_cast(tailOcclusionGrid.ActualWidth())); + contractAnimation.SetScalarParameter(L"Height", static_cast(tailOcclusionGrid.ActualHeight())); } } } @@ -117,17 +117,17 @@ void TeachingTip::OnPropertyChanged(const winrt::DependencyPropertyChangedEventA { UpdateButtonsState(); } - else if (property == s_TargetOffsetProperty) + else if (property == s_PlacementMarginProperty) { - OnTargetOffsetChanged(); + OnPlacementMarginChanged(); } else if (property == s_IsLightDismissEnabledProperty) { OnIsLightDismissEnabledChanged(); } - else if (property == s_PointerModeProperty) + else if (property == s_TailVisibilityProperty) { - OnPointerModeChanged(); + OnTailVisibilityChanged(); } else if (property == s_PreferredPlacementProperty) { @@ -178,15 +178,15 @@ void TeachingTip::CreateLightDismissIndicatorPopup() } } -void TeachingTip::UpdatePointer() +void TeachingTip::UpdateTail() { - // An effective placement of auto indicates that no pointer should be shown. + // An effective placement of auto indicates that no tail should be shown. auto placement = DetermineEffectivePlacement(); - m_currentEffectivePointerPlacementMode = placement; - auto&& pointerMode = PointerMode(); - if (pointerMode == winrt::TeachingTipPointerMode::Off || (!m_target && pointerMode != winrt::TeachingTipPointerMode::On)) + m_currentEffectiveTailPlacementMode = placement; + auto&& tailVisibility = TailVisibility(); + if (tailVisibility == winrt::TeachingTipTailVisibility::Collapsed || (!m_target && tailVisibility != winrt::TeachingTipTailVisibility::Visible)) { - m_currentEffectivePointerPlacementMode = winrt::TeachingTipPlacementMode::Auto; + m_currentEffectiveTailPlacementMode = winrt::TeachingTipPlacementMode::Auto; } if (placement != m_currentEffectiveTipPlacementMode) @@ -195,14 +195,14 @@ void TeachingTip::UpdatePointer() TeachingTipTestHooks::NotifyEffectivePlacementChanged(*this); } - auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get(); - auto&& pointerEdgeBorder = m_pointerEdgeBorder.get(); + auto&& tailOcclusionGrid = m_tailOcclusionGrid.get(); + auto&& tailEdgeBorder = m_tailEdgeBorder.get(); - float height = static_cast(pointerOcclusionGrid.ActualHeight()); - float width = static_cast(pointerOcclusionGrid.ActualWidth()); + float height = static_cast(tailOcclusionGrid.ActualHeight()); + float width = static_cast(tailOcclusionGrid.ActualWidth()); - auto columnDefinitions = pointerOcclusionGrid.ColumnDefinitions(); - auto rowDefinitions = pointerOcclusionGrid.RowDefinitions(); + auto columnDefinitions = tailOcclusionGrid.ColumnDefinitions(); + auto rowDefinitions = tailOcclusionGrid.RowDefinitions(); float firstColumnWidth = columnDefinitions.Size() > 0 ? static_cast(columnDefinitions.GetAt(0).ActualWidth()) : 0.0f; float secondColumnWidth = columnDefinitions.Size() > 1 ? static_cast(columnDefinitions.GetAt(1).ActualWidth()) : 0.0f; @@ -216,13 +216,13 @@ void TeachingTip::UpdatePointer() UpdateSizeBasedTemplateSettings(); - switch (m_currentEffectivePointerPlacementMode) + switch (m_currentEffectiveTailPlacementMode) { - // An effective placement of auto means the tip should not display a pointer. + // An effective placement of auto means the tip should not display a tail. case winrt::TeachingTipPlacementMode::Auto: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ width / 2, height / 2, 0.0f }); + tailOcclusionGrid.CenterPoint({ width / 2, height / 2, 0.0f }); } UpdateDynamicHeroContentPlacementToTop(); winrt::VisualStateManager::GoToState(*this, L"Untargeted"sv, false); @@ -231,8 +231,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::Top: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ width / 2, height - lastRowHeight, 0.0f }); - pointerEdgeBorder.CenterPoint({ (width / 2) - firstColumnWidth, 0.0f, 0.0f }); + tailOcclusionGrid.CenterPoint({ width / 2, height - lastRowHeight, 0.0f }); + tailEdgeBorder.CenterPoint({ (width / 2) - firstColumnWidth, 0.0f, 0.0f }); } UpdateDynamicHeroContentPlacementToTop(); winrt::VisualStateManager::GoToState(*this, L"Top"sv, false); @@ -241,8 +241,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::Bottom: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ width / 2, firstRowHeight, 0.0f }); - pointerEdgeBorder.CenterPoint({ (width / 2) - firstColumnWidth, 0.0f, 0.0f }); + tailOcclusionGrid.CenterPoint({ width / 2, firstRowHeight, 0.0f }); + tailEdgeBorder.CenterPoint({ (width / 2) - firstColumnWidth, 0.0f, 0.0f }); } UpdateDynamicHeroContentPlacementToBottom(); winrt::VisualStateManager::GoToState(*this, L"Bottom"sv, false); @@ -251,8 +251,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::Left: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ width - lastColumnWidth, (height / 2), 0.0f }); - pointerEdgeBorder.CenterPoint({ 0.0f, (height / 2) - firstRowHeight, 0.0f }); + tailOcclusionGrid.CenterPoint({ width - lastColumnWidth, (height / 2), 0.0f }); + tailEdgeBorder.CenterPoint({ 0.0f, (height / 2) - firstRowHeight, 0.0f }); } UpdateDynamicHeroContentPlacementToTop(); winrt::VisualStateManager::GoToState(*this, L"Left"sv, false); @@ -261,8 +261,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::Right: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ firstColumnWidth, height / 2, 0.0f }); - pointerEdgeBorder.CenterPoint({ 0.0f, (height / 2) - firstRowHeight, 0.0f }); + tailOcclusionGrid.CenterPoint({ firstColumnWidth, height / 2, 0.0f }); + tailEdgeBorder.CenterPoint({ 0.0f, (height / 2) - firstRowHeight, 0.0f }); } UpdateDynamicHeroContentPlacementToTop(); winrt::VisualStateManager::GoToState(*this, L"Right"sv, false); @@ -271,8 +271,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::TopEdgeAlignedRight: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ firstColumnWidth + secondColumnWidth + 1, height - lastRowHeight, 0.0f }); - pointerEdgeBorder.CenterPoint({ secondColumnWidth, 0.0f, 0.0f }); + tailOcclusionGrid.CenterPoint({ firstColumnWidth + secondColumnWidth + 1, height - lastRowHeight, 0.0f }); + tailEdgeBorder.CenterPoint({ secondColumnWidth, 0.0f, 0.0f }); } UpdateDynamicHeroContentPlacementToTop(); winrt::VisualStateManager::GoToState(*this, L"TopEdgeAlignedRight"sv, false); @@ -281,8 +281,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::TopEdgeAlignedLeft: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ width - (nextToLastColumnWidth + lastColumnWidth + 1), height - lastRowHeight, 0.0f }); - pointerEdgeBorder.CenterPoint({ width - (nextToLastColumnWidth + firstColumnWidth + lastColumnWidth), 0.0f, 0.0f }); + tailOcclusionGrid.CenterPoint({ width - (nextToLastColumnWidth + lastColumnWidth + 1), height - lastRowHeight, 0.0f }); + tailEdgeBorder.CenterPoint({ width - (nextToLastColumnWidth + firstColumnWidth + lastColumnWidth), 0.0f, 0.0f }); } UpdateDynamicHeroContentPlacementToTop(); winrt::VisualStateManager::GoToState(*this, L"TopEdgeAlignedLeft"sv, false); @@ -291,8 +291,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::BottomEdgeAlignedRight: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ firstColumnWidth + secondColumnWidth + 1, firstRowHeight, 0.0f }); - pointerEdgeBorder.CenterPoint({ secondColumnWidth, 0.0f, 0.0f }); + tailOcclusionGrid.CenterPoint({ firstColumnWidth + secondColumnWidth + 1, firstRowHeight, 0.0f }); + tailEdgeBorder.CenterPoint({ secondColumnWidth, 0.0f, 0.0f }); } UpdateDynamicHeroContentPlacementToBottom(); winrt::VisualStateManager::GoToState(*this, L"BottomEdgeAlignedRight"sv, false); @@ -301,8 +301,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::BottomEdgeAlignedLeft: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ width - (nextToLastColumnWidth + lastColumnWidth + 1), firstRowHeight, 0.0f }); - pointerEdgeBorder.CenterPoint({ width - (nextToLastColumnWidth + firstColumnWidth + lastColumnWidth), 0.0f, 0.0f }); + tailOcclusionGrid.CenterPoint({ width - (nextToLastColumnWidth + lastColumnWidth + 1), firstRowHeight, 0.0f }); + tailEdgeBorder.CenterPoint({ width - (nextToLastColumnWidth + firstColumnWidth + lastColumnWidth), 0.0f, 0.0f }); } UpdateDynamicHeroContentPlacementToBottom(); winrt::VisualStateManager::GoToState(*this, L"BottomEdgeAlignedLeft"sv, false); @@ -311,8 +311,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::LeftEdgeAlignedTop: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ width - lastColumnWidth, height - (nextToLastRowHeight + lastRowHeight + 1), 0.0f }); - pointerEdgeBorder.CenterPoint({ 0.0f, height - (nextToLastRowHeight + firstRowHeight + lastRowHeight), 0.0f }); + tailOcclusionGrid.CenterPoint({ width - lastColumnWidth, height - (nextToLastRowHeight + lastRowHeight + 1), 0.0f }); + tailEdgeBorder.CenterPoint({ 0.0f, height - (nextToLastRowHeight + firstRowHeight + lastRowHeight), 0.0f }); } UpdateDynamicHeroContentPlacementToTop(); winrt::VisualStateManager::GoToState(*this, L"LeftEdgeAlignedTop"sv, false); @@ -321,8 +321,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::LeftEdgeAlignedBottom: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ width - lastColumnWidth, (firstRowHeight + secondRowHeight + 1), 0.0f }); - pointerEdgeBorder.CenterPoint({ 0.0f, secondRowHeight, 0.0f }); + tailOcclusionGrid.CenterPoint({ width - lastColumnWidth, (firstRowHeight + secondRowHeight + 1), 0.0f }); + tailEdgeBorder.CenterPoint({ 0.0f, secondRowHeight, 0.0f }); } UpdateDynamicHeroContentPlacementToBottom(); winrt::VisualStateManager::GoToState(*this, L"LeftEdgeAlignedBottom"sv, false); @@ -331,8 +331,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::RightEdgeAlignedTop: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ firstColumnWidth, height - (nextToLastRowHeight + lastRowHeight + 1), 0.0f }); - pointerEdgeBorder.CenterPoint({ 0.0f, height - (nextToLastRowHeight + firstRowHeight + lastRowHeight), 0.0f }); + tailOcclusionGrid.CenterPoint({ firstColumnWidth, height - (nextToLastRowHeight + lastRowHeight + 1), 0.0f }); + tailEdgeBorder.CenterPoint({ 0.0f, height - (nextToLastRowHeight + firstRowHeight + lastRowHeight), 0.0f }); } UpdateDynamicHeroContentPlacementToTop(); winrt::VisualStateManager::GoToState(*this, L"RightEdgeAlignedTop"sv, false); @@ -341,8 +341,8 @@ void TeachingTip::UpdatePointer() case winrt::TeachingTipPlacementMode::RightEdgeAlignedBottom: if (SharedHelpers::IsRS5OrHigher()) { - pointerOcclusionGrid.CenterPoint({ firstColumnWidth, (firstRowHeight + secondRowHeight + 1), 0.0f }); - pointerEdgeBorder.CenterPoint({ 0.0f, secondRowHeight, 0.0f }); + tailOcclusionGrid.CenterPoint({ firstColumnWidth, (firstRowHeight + secondRowHeight + 1), 0.0f }); + tailEdgeBorder.CenterPoint({ 0.0f, secondRowHeight, 0.0f }); } UpdateDynamicHeroContentPlacementToBottom(); winrt::VisualStateManager::GoToState(*this, L"RightEdgeAlignedBottom"sv, false); @@ -370,12 +370,12 @@ void TeachingTip::PositionTargetedPopup() { if (auto&& popup = m_popup.get()) { - UpdatePointer(); - auto offset = TargetOffset(); + UpdateTail(); + auto offset = PlacementMargin(); - auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get(); - double tipHeight = pointerOcclusionGrid.ActualHeight(); - double tipWidth = pointerOcclusionGrid.ActualWidth(); + auto&& tailOcclusionGrid = m_tailOcclusionGrid.get(); + double tipHeight = tailOcclusionGrid.ActualHeight(); + double tipWidth = tailOcclusionGrid.ActualWidth(); // Depending on the effective placement mode of the tip we use a combination of the tip's size, the target's position within the app, the target's // size, and the target offset property to determine the appropriate vertical and horizontal offsets of the popup that the tip is contained in. @@ -403,41 +403,41 @@ void TeachingTip::PositionTargetedPopup() case winrt::TeachingTipPlacementMode::TopEdgeAlignedRight: popup.VerticalOffset(m_currentTargetBounds.Y - tipHeight - offset.Top); - popup.HorizontalOffset(((((m_currentTargetBounds.X * 2.0f) + m_currentTargetBounds.Width) / 2.0f) - MinimumTipEdgeToPointerCenter())); + popup.HorizontalOffset(((((m_currentTargetBounds.X * 2.0f) + m_currentTargetBounds.Width) / 2.0f) - MinimumTipEdgeToTailCenter())); break; case winrt::TeachingTipPlacementMode::TopEdgeAlignedLeft: popup.VerticalOffset(m_currentTargetBounds.Y - tipHeight - offset.Top); - popup.HorizontalOffset(((((m_currentTargetBounds.X * 2.0f) + m_currentTargetBounds.Width) / 2.0f) - tipWidth + MinimumTipEdgeToPointerCenter())); + popup.HorizontalOffset(((((m_currentTargetBounds.X * 2.0f) + m_currentTargetBounds.Width) / 2.0f) - tipWidth + MinimumTipEdgeToTailCenter())); break; case winrt::TeachingTipPlacementMode::BottomEdgeAlignedRight: popup.VerticalOffset(m_currentTargetBounds.Y + m_currentTargetBounds.Height + static_cast(offset.Bottom)); - popup.HorizontalOffset(((((m_currentTargetBounds.X * 2.0f) + m_currentTargetBounds.Width) / 2.0f) - MinimumTipEdgeToPointerCenter())); + popup.HorizontalOffset(((((m_currentTargetBounds.X * 2.0f) + m_currentTargetBounds.Width) / 2.0f) - MinimumTipEdgeToTailCenter())); break; case winrt::TeachingTipPlacementMode::BottomEdgeAlignedLeft: popup.VerticalOffset(m_currentTargetBounds.Y + m_currentTargetBounds.Height + static_cast(offset.Bottom)); - popup.HorizontalOffset(((((m_currentTargetBounds.X * 2.0f) + m_currentTargetBounds.Width) / 2.0f) - tipWidth + MinimumTipEdgeToPointerCenter())); + popup.HorizontalOffset(((((m_currentTargetBounds.X * 2.0f) + m_currentTargetBounds.Width) / 2.0f) - tipWidth + MinimumTipEdgeToTailCenter())); break; case winrt::TeachingTipPlacementMode::LeftEdgeAlignedTop: - popup.VerticalOffset((((m_currentTargetBounds.Y * 2.0f) + m_currentTargetBounds.Height) / 2.0f) - tipHeight + MinimumTipEdgeToPointerCenter()); + popup.VerticalOffset((((m_currentTargetBounds.Y * 2.0f) + m_currentTargetBounds.Height) / 2.0f) - tipHeight + MinimumTipEdgeToTailCenter()); popup.HorizontalOffset(m_currentTargetBounds.X - tipWidth - offset.Left); break; case winrt::TeachingTipPlacementMode::LeftEdgeAlignedBottom: - popup.VerticalOffset((((m_currentTargetBounds.Y * 2.0f) + m_currentTargetBounds.Height) / 2.0f) - MinimumTipEdgeToPointerCenter()); + popup.VerticalOffset((((m_currentTargetBounds.Y * 2.0f) + m_currentTargetBounds.Height) / 2.0f) - MinimumTipEdgeToTailCenter()); popup.HorizontalOffset(m_currentTargetBounds.X - tipWidth - offset.Left); break; case winrt::TeachingTipPlacementMode::RightEdgeAlignedTop: - popup.VerticalOffset((((m_currentTargetBounds.Y * 2.0f) + m_currentTargetBounds.Height) / 2.0f) - tipHeight + MinimumTipEdgeToPointerCenter()); + popup.VerticalOffset((((m_currentTargetBounds.Y * 2.0f) + m_currentTargetBounds.Height) / 2.0f) - tipHeight + MinimumTipEdgeToTailCenter()); popup.HorizontalOffset(m_currentTargetBounds.X + m_currentTargetBounds.Width + static_cast(offset.Right)); break; case winrt::TeachingTipPlacementMode::RightEdgeAlignedBottom: - popup.VerticalOffset((((m_currentTargetBounds.Y * 2.0f) + m_currentTargetBounds.Height) / 2.0f) - MinimumTipEdgeToPointerCenter()); + popup.VerticalOffset((((m_currentTargetBounds.Y * 2.0f) + m_currentTargetBounds.Height) / 2.0f) - MinimumTipEdgeToTailCenter()); popup.HorizontalOffset(m_currentTargetBounds.X + m_currentTargetBounds.Width + static_cast(offset.Right)); break; @@ -451,13 +451,13 @@ void TeachingTip::PositionUntargetedPopup() { auto windowBounds = m_useTestWindowBounds ? m_testWindowBounds : winrt::Window::Current().CoreWindow().Bounds(); - auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get(); - double finalTipHeight = pointerOcclusionGrid.ActualHeight(); - double finalTipWidth = pointerOcclusionGrid.ActualWidth(); + auto&& tailOcclusionGrid = m_tailOcclusionGrid.get(); + double finalTipHeight = tailOcclusionGrid.ActualHeight(); + double finalTipWidth = tailOcclusionGrid.ActualWidth(); - UpdatePointer(); + UpdateTail(); - auto offset = TargetOffset(); + auto offset = PlacementMargin(); // Depending on the effective placement mode of the tip we use a combination of the tip's size, the window's size, and the target // offset property to determine the appropriate vertical and horizontal offsets of the popup that the tip is contained in. @@ -538,7 +538,7 @@ void TeachingTip::UpdateSizeBasedTemplateSettings() auto height = contentRootGrid.ActualHeight(); auto floatWidth = static_cast(width); auto floatHeight = static_cast(height); - switch (m_currentEffectivePointerPlacementMode) + switch (m_currentEffectiveTailPlacementMode) { case winrt::TeachingTipPlacementMode::Top: templateSettings->TopRightHighlightMargin(OtherPlacementTopRightHighlightMargin(width, height)); @@ -766,9 +766,9 @@ void TeachingTip::OnIsOpenChanged() TeachingTipTestHooks::NotifyOpenedStatusChanged(*this); } -void TeachingTip::OnPointerModeChanged() +void TeachingTip::OnTailVisibilityChanged() { - UpdatePointer(); + UpdateTail(); } void TeachingTip::OnIconSourceChanged() @@ -786,7 +786,7 @@ void TeachingTip::OnIconSourceChanged() } } -void TeachingTip::OnTargetOffsetChanged() +void TeachingTip::OnPlacementMarginChanged() { if (IsOpen()) { @@ -887,10 +887,10 @@ void TeachingTip::OnLightDismissIndicatorPopupClosed(const winrt::IInspectable&, IsOpen(false); } -void TeachingTip::OnPointerOcclusionGridLoaded(const winrt::IInspectable&, const winrt::IInspectable&) +void TeachingTip::OnTailOcclusionGridLoaded(const winrt::IInspectable&, const winrt::IInspectable&) { StartExpandToOpen(); - m_pointerOcclusionGridLoadedRevoker.revoke(); + m_tailOcclusionGridLoadedRevoker.revoke(); } @@ -956,7 +956,7 @@ void TeachingTip::ClosePopup() { lightDismissIndicatorPopup.IsOpen(false); } - if (auto && pointerOcclusionGrid = m_pointerOcclusionGrid.get()) + if (auto && tailOcclusionGrid = m_tailOcclusionGrid.get()) { if (SharedHelpers::IsRS5OrHigher()) { @@ -964,7 +964,7 @@ void TeachingTip::ClosePopup() // is shown again then its text would be rasterized at this small scale and blown up ~20x. To fix this we have to // reset the scale after the popup has closed so that if the teaching tip is reshown the render pass does not use the // small scale. - pointerOcclusionGrid.Scale({ 1.0f,1.0f,1.0f }); + tailOcclusionGrid.Scale({ 1.0f,1.0f,1.0f }); } } } @@ -1057,10 +1057,10 @@ void TeachingTip::CreateExpandAnimation() m_expandEasingFunction.set(compositor.CreateCubicBezierEasingFunction(s_expandAnimationEasingCurveControlPoint1, s_expandAnimationEasingCurveControlPoint2)); } auto expandAnimation = compositor.CreateVector3KeyFrameAnimation(); - if (auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get()) + if (auto&& tailOcclusionGrid = m_tailOcclusionGrid.get()) { - expandAnimation.SetScalarParameter(L"Width", static_cast(pointerOcclusionGrid.ActualWidth())); - expandAnimation.SetScalarParameter(L"Height", static_cast(pointerOcclusionGrid.ActualHeight())); + expandAnimation.SetScalarParameter(L"Width", static_cast(tailOcclusionGrid.ActualWidth())); + expandAnimation.SetScalarParameter(L"Height", static_cast(tailOcclusionGrid.ActualHeight())); } else { @@ -1092,10 +1092,10 @@ void TeachingTip::CreateContractAnimation() } auto contractAnimation = compositor.CreateVector3KeyFrameAnimation(); - if (auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get()) + if (auto&& tailOcclusionGrid = m_tailOcclusionGrid.get()) { - contractAnimation.SetScalarParameter(L"Width", static_cast(pointerOcclusionGrid.ActualWidth())); - contractAnimation.SetScalarParameter(L"Height", static_cast(pointerOcclusionGrid.ActualHeight())); + contractAnimation.SetScalarParameter(L"Width", static_cast(tailOcclusionGrid.ActualWidth())); + contractAnimation.SetScalarParameter(L"Height", static_cast(tailOcclusionGrid.ActualHeight())); } else { @@ -1128,9 +1128,9 @@ void TeachingTip::StartExpandToOpen() } auto scopedBatch = winrt::Window::Current().Compositor().CreateScopedBatch(winrt::CompositionBatchTypes::Animation); auto&& expandAnimation = m_expandAnimation.get(); - if (auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get()) + if (auto&& tailOcclusionGrid = m_tailOcclusionGrid.get()) { - pointerOcclusionGrid.StartAnimation(expandAnimation); + tailOcclusionGrid.StartAnimation(expandAnimation); m_isExpandAnimationPlaying = true; } if (auto&& contentRootGrid = m_contentRootGrid.get()) @@ -1138,9 +1138,9 @@ void TeachingTip::StartExpandToOpen() contentRootGrid.StartAnimation(m_expandElevationAnimation.get()); m_isExpandAnimationPlaying = true; } - if (auto&& pointerEdgeBorder = m_pointerEdgeBorder.get()) + if (auto&& tailEdgeBorder = m_tailEdgeBorder.get()) { - pointerEdgeBorder.StartAnimation(expandAnimation); + tailEdgeBorder.StartAnimation(expandAnimation); m_isExpandAnimationPlaying = true; } scopedBatch.End(); @@ -1177,9 +1177,9 @@ void TeachingTip::StartContractToClose() auto scopedBatch = winrt::Window::Current().Compositor().CreateScopedBatch(winrt::CompositionBatchTypes::Animation); auto&& contractAnimation = m_contractAnimation.get(); - if (auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get()) + if (auto&& tailOcclusionGrid = m_tailOcclusionGrid.get()) { - pointerOcclusionGrid.StartAnimation(contractAnimation); + tailOcclusionGrid.StartAnimation(contractAnimation); m_isContractAnimationPlaying = true; } if (auto&& contentRootGrid = m_contentRootGrid.get()) @@ -1187,9 +1187,9 @@ void TeachingTip::StartContractToClose() contentRootGrid.StartAnimation(m_contractElevationAnimation.get()); m_isContractAnimationPlaying = true; } - if (auto&& pointerEdgeBorder = m_pointerEdgeBorder.get()) + if (auto&& tailEdgeBorder = m_tailEdgeBorder.get()) { - pointerEdgeBorder.StartAnimation(contractAnimation); + tailEdgeBorder.StartAnimation(contractAnimation); m_isContractAnimationPlaying = true; } scopedBatch.End(); @@ -1244,15 +1244,15 @@ winrt::TeachingTipPlacementMode TeachingTip::DetermineEffectivePlacement() targetBounds.Y -= windowBounds.Y; } - auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get(); - double contentHeight = pointerOcclusionGrid.ActualHeight(); - double contentWidth = pointerOcclusionGrid.ActualWidth(); - double tipHeight = contentHeight + PointerShortSideLength(); - double tipWidth = contentWidth + PointerShortSideLength(); + auto&& tailOcclusionGrid = m_tailOcclusionGrid.get(); + double contentHeight = tailOcclusionGrid.ActualHeight(); + double contentWidth = tailOcclusionGrid.ActualWidth(); + double tipHeight = contentHeight + TailShortSideLength(); + double tipWidth = contentWidth + TailShortSideLength(); if (HeroContent()) { - if (m_heroContentBorder.get().ActualHeight() > m_nonHeroContentRootGrid.get().ActualHeight() - PointerLongSideActualLength()) + if (m_heroContentBorder.get().ActualHeight() > m_nonHeroContentRootGrid.get().ActualHeight() - TailLongSideActualLength()) { leftCenterAvailable = false; rightCenterAvailable = false; @@ -1307,8 +1307,8 @@ winrt::TeachingTipPlacementMode TeachingTip::DetermineEffectivePlacement() } // If the horizontal midpoint is out of the window. - if (targetBounds.X + (targetBounds.Width / 2) < MinimumTipEdgeToPointerCenter() || - targetBounds.X + (targetBounds.Width / 2) > windowBounds.Width - MinimumTipEdgeToPointerCenter()) + if (targetBounds.X + (targetBounds.Width / 2) < MinimumTipEdgeToTailCenter() || + targetBounds.X + (targetBounds.Width / 2) > windowBounds.Width - MinimumTipEdgeToTailCenter()) { topLeftAvailable = false; topCenterAvailable = false; @@ -1319,8 +1319,8 @@ winrt::TeachingTipPlacementMode TeachingTip::DetermineEffectivePlacement() } // If the vertical midpoint is out of the window. - if (targetBounds.Y + (targetBounds.Height / 2) < MinimumTipEdgeToPointerCenter() || - targetBounds.Y + (targetBounds.Height / 2) > windowBounds.Height - MinimumTipEdgeToPointerCenter()) + if (targetBounds.Y + (targetBounds.Height / 2) < MinimumTipEdgeToTailCenter() || + targetBounds.Y + (targetBounds.Height / 2) > windowBounds.Height - MinimumTipEdgeToTailCenter()) { leftBottomAvailable = false; leftCenterAvailable = false; @@ -1338,12 +1338,12 @@ winrt::TeachingTipPlacementMode TeachingTip::DetermineEffectivePlacement() topLeftAvailable = false; } // If the tip is too tall to fit between the center of the target and the top edge of the window. - if (contentHeight - MinimumTipEdgeToPointerCenter() > targetBounds.Y + (targetBounds.Height / 2.0f)) + if (contentHeight - MinimumTipEdgeToTailCenter() > targetBounds.Y + (targetBounds.Height / 2.0f)) { rightTopAvailable = false; leftTopAvailable = false; } - // If the tip is too tall to fit in the window when the pointer is centered vertically on the target and the tip. + // If the tip is too tall to fit in the window when the tail is centered vertically on the target and the tip. if (contentHeight / 2.0f > targetBounds.Y + targetBounds.Height / 2.0f || contentHeight / 2.0f > (windowBounds.Height - (targetBounds.Height + targetBounds.Y) + (targetBounds.Height / 2.0f))) { @@ -1351,7 +1351,7 @@ winrt::TeachingTipPlacementMode TeachingTip::DetermineEffectivePlacement() leftCenterAvailable = false; } // If the tip is too tall to fit between the center of the target and the bottom edge of the window. - if (contentHeight - MinimumTipEdgeToPointerCenter() > windowBounds.Height - (targetBounds.Y + (targetBounds.Height / 2.0f))) + if (contentHeight - MinimumTipEdgeToTailCenter() > windowBounds.Height - (targetBounds.Y + (targetBounds.Height / 2.0f))) { rightBottomAvailable = false; leftBottomAvailable = false; @@ -1372,12 +1372,12 @@ winrt::TeachingTipPlacementMode TeachingTip::DetermineEffectivePlacement() leftBottomAvailable = false; } // If the tip is too wide to fit between the center of the target and the left edge of the window. - if (contentWidth - MinimumTipEdgeToPointerCenter() > targetBounds.X + (targetBounds.Width / 2.0f)) + if (contentWidth - MinimumTipEdgeToTailCenter() > targetBounds.X + (targetBounds.Width / 2.0f)) { topLeftAvailable = false; bottomLeftAvailable = false; } - // If the tip is too wide to fit in the window when the pointer is centered horizontally on the target and the tip. + // If the tip is too wide to fit in the window when the tail is centered horizontally on the target and the tip. if (contentWidth / 2.0f > targetBounds.X + targetBounds.Width / 2.0f || contentWidth / 2.0f > (windowBounds.Width - (targetBounds.Width + targetBounds.X) + (targetBounds.Width / 2.0f))) { @@ -1385,7 +1385,7 @@ winrt::TeachingTipPlacementMode TeachingTip::DetermineEffectivePlacement() bottomCenterAvailable = false; } // If the tip is too wide to fit between the center of the target and the right edge of the window. - if (contentWidth - MinimumTipEdgeToPointerCenter() > windowBounds.Width - (targetBounds.X + (targetBounds.Width / 2.0f))) + if (contentWidth - MinimumTipEdgeToTailCenter() > windowBounds.Width - (targetBounds.X + (targetBounds.Width / 2.0f))) { topRightAvailable = false; bottomRightAvailable = false; @@ -1457,26 +1457,26 @@ winrt::TeachingTipPlacementMode TeachingTip::DetermineEffectivePlacement() void TeachingTip::EstablishShadows() { #ifdef USE_INSIDER_SDK -#ifdef POINTER_SHADOW +#ifdef TAIL_SHADOW #ifdef _DEBUG - if (winrt::IUIElement10 pointerPolygon_uiElement10 = m_pointerPolygon.get()) + if (winrt::IUIElement10 tailPolygon_uiElement10 = m_tailPolygon.get()) { if (m_tipShadow) { - if (!pointerPolygon_uiElement10.Shadow()) + if (!tailPolygon_uiElement10.Shadow()) { - // This facilitates an experiment around faking a proper pointer shadow, shadows are expensive though so we don't want it present for release builds. - auto pointerShadow = winrt::Windows::UI::Xaml::Media::ThemeShadow{}; - pointerShadow.Receivers().Append(m_target.get()); - pointerPolygon_uiElement10.Shadow(pointerShadow); - auto&& pointerPolygon = m_pointerPolygon.get(); - auto&& pointerPolygonTranslation = pointerPolygon.Translation(); - pointerPolygon.Translation({ pointerPolygonTranslation.x, pointerPolygonTranslation.y, m_pointerElevation }); + // This facilitates an experiment around faking a proper tail shadow, shadows are expensive though so we don't want it present for release builds. + auto tailShadow = winrt::Windows::UI::Xaml::Media::ThemeShadow{}; + tailShadow.Receivers().Append(m_target.get()); + tailPolygon_uiElement10.Shadow(tailShadow); + auto&& tailPolygon = m_tailPolygon.get(); + auto&& tailPolygonTranslation = tailPolygon.Translation(); + tailPolygon.Translation({ tailPolygonTranslation.x, tailPolygonTranslation.y, m_tailElevation }); } } else { - pointerPolygon_uiElement10.Shadow(nullptr); + tailPolygon_uiElement10.Shadow(nullptr); } } #endif @@ -1537,10 +1537,10 @@ void TeachingTip::SetContentElevation(float elevation) m_contentElevation = elevation; if (SharedHelpers::IsRS5OrHigher()) { - if (auto&& pointerOcclusionGrid = m_pointerOcclusionGrid.get()) + if (auto&& tailOcclusionGrid = m_tailOcclusionGrid.get()) { - auto pointerOcclusionGridTranslation = pointerOcclusionGrid.Translation(); - m_contentRootGrid.get().Translation({ pointerOcclusionGridTranslation.x, pointerOcclusionGridTranslation.y, m_contentElevation }); + auto tailOcclusionGridTranslation = tailOcclusionGrid.Translation(); + m_contentRootGrid.get().Translation({ tailOcclusionGridTranslation.x, tailOcclusionGridTranslation.y, m_contentElevation }); } if (m_expandElevationAnimation) { @@ -1549,15 +1549,15 @@ void TeachingTip::SetContentElevation(float elevation) } } -void TeachingTip::SetPointerElevation(float elevation) +void TeachingTip::SetTailElevation(float elevation) { - m_pointerElevation = elevation; - if (SharedHelpers::IsRS5OrHigher() && m_pointerPolygon) + m_tailElevation = elevation; + if (SharedHelpers::IsRS5OrHigher() && m_tailPolygon) { - if (auto && pointerPolygon = m_pointerPolygon.get()) + if (auto && tailPolygon = m_tailPolygon.get()) { - auto pointerPolygonTranslation = pointerPolygon.Translation(); - pointerPolygon.Translation({ pointerPolygonTranslation.x, pointerPolygonTranslation.y, m_pointerElevation }); + auto tailPolygonTranslation = tailPolygon.Translation(); + tailPolygon.Translation({ tailPolygonTranslation.x, tailPolygonTranslation.y, m_tailElevation }); } } } diff --git a/dev/TeachingTip/TeachingTip.h b/dev/TeachingTip/TeachingTip.h index 8266d00ea5..4a70aac695 100644 --- a/dev/TeachingTip/TeachingTip.h +++ b/dev/TeachingTip/TeachingTip.h @@ -33,7 +33,7 @@ class TeachingTip : void SetContractEasingFunction(const winrt::CompositionEasingFunction& easingFunction); void SetTipShouldHaveShadow(bool tipShadow); void SetContentElevation(float elevation); - void SetPointerElevation(float elevation); + void SetTailElevation(float elevation); bool GetIsIdle(); winrt::TeachingTipPlacementMode GetEffectivePlacement(); winrt::TeachingTipHeroContentPlacementMode GetEffectiveHeroContentPlacement(); @@ -57,9 +57,9 @@ class TeachingTip : winrt::Popup::Closed_revoker m_popupClosedRevoker{}; winrt::Popup::Closed_revoker m_lightDismissIndicatorPopupClosedRevoker{}; winrt::Window::SizeChanged_revoker m_windowSizeChangedRevoker{}; - winrt::Grid::Loaded_revoker m_pointerOcclusionGridLoadedRevoker{}; + winrt::Grid::Loaded_revoker m_tailOcclusionGridLoadedRevoker{}; void CreateLightDismissIndicatorPopup(); - void UpdatePointer(); + void UpdateTail(); void PositionPopup(); void PositionTargetedPopup(); void PositionUntargetedPopup(); @@ -74,9 +74,9 @@ class TeachingTip : void OnIsOpenChanged(); void OnTargetChanged(); - void OnPointerModeChanged(); + void OnTailVisibilityChanged(); void OnIconSourceChanged(); - void OnTargetOffsetChanged(); + void OnPlacementMarginChanged(); void OnIsLightDismissEnabledChanged(); void OnHeroContentPlacementChanged(); @@ -85,7 +85,7 @@ class TeachingTip : void OnPopupOpened(const winrt::IInspectable&, const winrt::IInspectable&); void OnPopupClosed(const winrt::IInspectable&, const winrt::IInspectable&); void OnLightDismissIndicatorPopupClosed(const winrt::IInspectable&, const winrt::IInspectable&); - void OnPointerOcclusionGridLoaded(const winrt::IInspectable&, const winrt::IInspectable&); + void OnTailOcclusionGridLoaded(const winrt::IInspectable&, const winrt::IInspectable&); void RaiseClosingEvent(); void ClosePopupWithAnimationIfAvailable(); @@ -110,7 +110,7 @@ class TeachingTip : tracker_ref m_lightDismissIndicatorPopup{ this }; tracker_ref m_rootElement{ this }; - tracker_ref m_pointerOcclusionGrid{ this }; + tracker_ref m_tailOcclusionGrid{ this }; tracker_ref m_contentRootGrid{ this }; tracker_ref m_nonHeroContentRootGrid{ this }; tracker_ref m_heroContentBorder{ this }; @@ -118,8 +118,8 @@ class TeachingTip : tracker_ref m_actionButton{ this }; tracker_ref m_alternateCloseButton{ this }; tracker_ref m_closeButton{ this }; - tracker_ref m_pointerPolygon{ this }; - tracker_ref m_pointerEdgeBorder{ this }; + tracker_ref m_tailPolygon{ this }; + tracker_ref m_tailEdgeBorder{ this }; tracker_ref m_expandAnimation{ this }; tracker_ref m_contractAnimation{ this }; @@ -129,7 +129,7 @@ class TeachingTip : tracker_ref m_contractEasingFunction{ this }; winrt::TeachingTipPlacementMode m_currentEffectiveTipPlacementMode{ winrt::TeachingTipPlacementMode::Auto }; - winrt::TeachingTipPlacementMode m_currentEffectivePointerPlacementMode{ winrt::TeachingTipPlacementMode::Auto }; + winrt::TeachingTipPlacementMode m_currentEffectiveTailPlacementMode{ winrt::TeachingTipPlacementMode::Auto }; winrt::TeachingTipHeroContentPlacementMode m_currentHeroContentEffectivePlacementMode{ winrt::TeachingTipHeroContentPlacementMode::Auto }; winrt::Rect m_currentBounds{ 0,0,0,0 }; @@ -148,8 +148,8 @@ class TeachingTip : bool m_tipFollowsTarget{ false }; float m_contentElevation{ 32.0f }; - float m_pointerElevation{ 0.0f }; - bool m_pointerShadowTargetsShadowTarget{ false }; + float m_tailElevation{ 0.0f }; + bool m_tailShadowTargetsShadowTarget{ false }; bool m_isIdle{ true }; @@ -159,16 +159,16 @@ class TeachingTip : winrt::TeachingTipCloseReason m_lastCloseReason{ winrt::TeachingTipCloseReason::Programmatic }; // These values are shifted by one because this is the 1px highlight that sits adjacent to the tip border. - inline winrt::Thickness BottomPlacementTopRightHighlightMargin(double width, double height) { return { (width / 2) + (PointerShortSideLength() - 1.0f), 0, 1, 0 }; } - inline winrt::Thickness BottomEdgeAlignedRightPlacementTopRightHighlightMargin(double width, double height) { return { MinimumTipEdgeToPointerEdgeMargin() + PointerLongSideLength() - 1.0f, 0, 1, 0 }; } - inline winrt::Thickness BottomEdgeAlignedLeftPlacementTopRightHighlightMargin(double width, double height) { return { width - (MinimumTipEdgeToPointerEdgeMargin() + 1.0f), 0, 1, 0 }; } + inline winrt::Thickness BottomPlacementTopRightHighlightMargin(double width, double height) { return { (width / 2) + (TailShortSideLength() - 1.0f), 0, 1, 0 }; } + inline winrt::Thickness BottomEdgeAlignedRightPlacementTopRightHighlightMargin(double width, double height) { return { MinimumTipEdgeToTailEdgeMargin() + TailLongSideLength() - 1.0f, 0, 1, 0 }; } + inline winrt::Thickness BottomEdgeAlignedLeftPlacementTopRightHighlightMargin(double width, double height) { return { width - (MinimumTipEdgeToTailEdgeMargin() + 1.0f), 0, 1, 0 }; } static inline winrt::Thickness OtherPlacementTopRightHighlightMargin(double width, double height) { return { 0, 0, 0, 0 }; } - inline winrt::Thickness BottomPlacementTopLeftHighlightMargin(double width, double height) { return { 1, 0, (width / 2) + (PointerShortSideLength() - 1.0f), 0 }; } - inline winrt::Thickness BottomEdgeAlignedRightPlacementTopLeftHighlightMargin(double width, double height) { return { 1, 0, width - (MinimumTipEdgeToPointerEdgeMargin() + 1.0f), 0 }; } - inline winrt::Thickness BottomEdgeAlignedLeftPlacementTopLeftHighlightMargin(double width, double height) { return { 1, 0, MinimumTipEdgeToPointerEdgeMargin() + PointerLongSideLength() - 1.0f, 0 }; } + inline winrt::Thickness BottomPlacementTopLeftHighlightMargin(double width, double height) { return { 1, 0, (width / 2) + (TailShortSideLength() - 1.0f), 0 }; } + inline winrt::Thickness BottomEdgeAlignedRightPlacementTopLeftHighlightMargin(double width, double height) { return { 1, 0, width - (MinimumTipEdgeToTailEdgeMargin() + 1.0f), 0 }; } + inline winrt::Thickness BottomEdgeAlignedLeftPlacementTopLeftHighlightMargin(double width, double height) { return { 1, 0, MinimumTipEdgeToTailEdgeMargin() + TailLongSideLength() - 1.0f, 0 }; } static inline winrt::Thickness TopEdgePlacementTopLeftHighlightMargin(double width, double height) { return { 1, 1, 1, 0 }; } - // Shifted by one since the pointer edge's border is not accounted for automatically. + // Shifted by one since the tail edge's border is not accounted for automatically. static inline winrt::Thickness LeftEdgePlacementTopLeftHighlightMargin(double width, double height) { return { 1, 1, 0, 0 }; } static inline winrt::Thickness RightEdgePlacementTopLeftHighlightMargin(double width, double height) { return { 0, 1, 1, 0 }; } @@ -181,7 +181,7 @@ class TeachingTip : static constexpr wstring_view s_containerName{ L"Container"sv }; static constexpr wstring_view s_popupName{ L"Popup"sv }; - static constexpr wstring_view s_pointerOcclusionGridName{ L"PointerOcclusionGrid"sv }; + static constexpr wstring_view s_tailOcclusionGridName{ L"TailOcclusionGrid"sv }; static constexpr wstring_view s_contentRootGridName{ L"ContentRootGrid"sv }; static constexpr wstring_view s_nonHeroContentRootGridName{ L"NonHeroContentRootGrid"sv }; static constexpr wstring_view s_shadowTargetName{ L"ShadowTarget"sv }; @@ -194,9 +194,9 @@ class TeachingTip : static constexpr wstring_view s_mainContentPresenterName{ L"MainContentPresenter"sv }; static constexpr wstring_view s_actionButtonName{ L"ActionButton"sv }; static constexpr wstring_view s_closeButtonName{ L"CloseButton"sv }; - static constexpr wstring_view s_pointerPolygonName{ L"PointerPolygon"sv }; - static constexpr wstring_view s_pointerEdgeBorderName{ L"PointerEdgeBorder"sv }; - static constexpr wstring_view s_topPointerPolygonHighlightName{ L"TopPointerPolygonHighlight"sv }; + static constexpr wstring_view s_tailPolygonName{ L"TailPolygon"sv }; + static constexpr wstring_view s_tailEdgeBorderName{ L"TailEdgeBorder"sv }; + static constexpr wstring_view s_topTailPolygonHighlightName{ L"TopTailPolygonHighlight"sv }; static constexpr wstring_view s_topHighlightLeftName{ L"TopHighlightLeft"sv }; static constexpr wstring_view s_topHighlightRightName{ L"TopHighlightRight"sv }; @@ -213,27 +213,27 @@ class TeachingTip : static constexpr float s_defaultTipHeightAndWidth = 320; //Ideally this would be computed from layout but it is difficult to do. - static constexpr float s_pointerOcclusionAmount = 2; + static constexpr float s_tailOcclusionAmount = 2; - // The pointer is designed as an 8x16 pixel shape, however it is actually a 10x20 shape which is partially occluded by the tip content. - // This is done to get the border of the tip to follow the pointer shape without drawing the border on the tip edge of the pointer. - inline float MinimumTipEdgeToPointerEdgeMargin() + // The tail is designed as an 8x16 pixel shape, however it is actually a 10x20 shape which is partially occluded by the tip content. + // This is done to get the border of the tip to follow the tail shape without drawing the border on the tip edge of the tail. + inline float MinimumTipEdgeToTailEdgeMargin() { - return m_pointerOcclusionGrid.get().ColumnDefinitions().Size() > 1 ? - static_cast(m_pointerOcclusionGrid.get().ColumnDefinitions().GetAt(1).ActualWidth() + s_pointerOcclusionAmount) + return m_tailOcclusionGrid.get().ColumnDefinitions().Size() > 1 ? + static_cast(m_tailOcclusionGrid.get().ColumnDefinitions().GetAt(1).ActualWidth() + s_tailOcclusionAmount) : 0.0f; } - inline float MinimumTipEdgeToPointerCenter() + inline float MinimumTipEdgeToTailCenter() { - return m_pointerOcclusionGrid.get().ColumnDefinitions().Size() > 1 ? - static_cast(m_pointerOcclusionGrid.get().ColumnDefinitions().GetAt(0).ActualWidth() + - m_pointerOcclusionGrid.get().ColumnDefinitions().GetAt(1).ActualWidth() + - (std::max(m_pointerPolygon.get().ActualHeight(), m_pointerPolygon.get().ActualWidth()) / 2)) + return m_tailOcclusionGrid.get().ColumnDefinitions().Size() > 1 ? + static_cast(m_tailOcclusionGrid.get().ColumnDefinitions().GetAt(0).ActualWidth() + + m_tailOcclusionGrid.get().ColumnDefinitions().GetAt(1).ActualWidth() + + (std::max(m_tailPolygon.get().ActualHeight(), m_tailPolygon.get().ActualWidth()) / 2)) : 0.0f; } - inline float PointerLongSideActualLength() { return static_cast(std::max(m_pointerPolygon.get().ActualHeight(), m_pointerPolygon.get().ActualWidth())); } - inline float PointerLongSideLength() { return static_cast(PointerLongSideActualLength() - (2 * s_pointerOcclusionAmount)); } - inline float PointerShortSideLength() { return static_cast(std::min(m_pointerPolygon.get().ActualHeight(), m_pointerPolygon.get().ActualWidth()) - s_pointerOcclusionAmount); } + inline float TailLongSideActualLength() { return static_cast(std::max(m_tailPolygon.get().ActualHeight(), m_tailPolygon.get().ActualWidth())); } + inline float TailLongSideLength() { return static_cast(TailLongSideActualLength() - (2 * s_tailOcclusionAmount)); } + inline float TailShortSideLength() { return static_cast(std::min(m_tailPolygon.get().ActualHeight(), m_tailPolygon.get().ActualWidth()) - s_tailOcclusionAmount); } }; diff --git a/dev/TeachingTip/TeachingTip.idl b/dev/TeachingTip/TeachingTip.idl index 17f4e4f367..55d57eb224 100644 --- a/dev/TeachingTip/TeachingTip.idl +++ b/dev/TeachingTip/TeachingTip.idl @@ -1,10 +1,10 @@ [WUXC_VERSION_PREVIEW] [webhosthidden] -enum TeachingTipPointerMode +enum TeachingTipTailVisibility { Auto, - On, - Off, + Visible, + Collapsed, }; [WUXC_VERSION_PREVIEW] @@ -92,8 +92,8 @@ unsealed runtimeclass TeachingTip : Windows.UI.Xaml.Controls.ContentControl Windows.UI.Xaml.FrameworkElement Target; - [MUX_DEFAULT_VALUE("winrt::TeachingTipPointerMode::Auto")] - TeachingTipPointerMode PointerMode; + [MUX_DEFAULT_VALUE("winrt::TeachingTipTailVisibility::Auto")] + TeachingTipTailVisibility TailVisibility; Object ActionButtonContent; Windows.UI.Xaml.Style ActionButtonStyle; @@ -105,7 +105,7 @@ unsealed runtimeclass TeachingTip : Windows.UI.Xaml.Controls.ContentControl Windows.UI.Xaml.Input.ICommand CloseButtonCommand; Object CloseButtonCommandParameter; - Windows.UI.Xaml.Thickness TargetOffset; + Windows.UI.Xaml.Thickness PlacementMargin; [MUX_DEFAULT_VALUE("false")] Boolean IsLightDismissEnabled; [MUX_DEFAULT_VALUE("winrt::TeachingTipPlacementMode::Auto")] @@ -127,7 +127,7 @@ unsealed runtimeclass TeachingTip : Windows.UI.Xaml.Controls.ContentControl static Windows.UI.Xaml.DependencyProperty TargetProperty{ get; }; - static Windows.UI.Xaml.DependencyProperty PointerModeProperty{ get; }; + static Windows.UI.Xaml.DependencyProperty TailVisibilityProperty{ get; }; static Windows.UI.Xaml.DependencyProperty TitleProperty{ get; }; static Windows.UI.Xaml.DependencyProperty SubtitleProperty{ get; }; @@ -142,7 +142,7 @@ unsealed runtimeclass TeachingTip : Windows.UI.Xaml.Controls.ContentControl static Windows.UI.Xaml.DependencyProperty CloseButtonCommandProperty{ get; }; static Windows.UI.Xaml.DependencyProperty CloseButtonCommandParameterProperty{ get; }; - static Windows.UI.Xaml.DependencyProperty TargetOffsetProperty{ get; }; + static Windows.UI.Xaml.DependencyProperty PlacementMarginProperty{ get; }; static Windows.UI.Xaml.DependencyProperty IsLightDismissEnabledProperty{ get; }; static Windows.UI.Xaml.DependencyProperty PreferredPlacementProperty{ get; }; static Windows.UI.Xaml.DependencyProperty HeroContentPlacementProperty{ get; }; diff --git a/dev/TeachingTip/TeachingTip.xaml b/dev/TeachingTip/TeachingTip.xaml index 29ea12f10d..2203e705b8 100644 --- a/dev/TeachingTip/TeachingTip.xaml +++ b/dev/TeachingTip/TeachingTip.xaml @@ -17,9 +17,9 @@ - - - + + + @@ -115,289 +115,289 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - + + - + @@ -408,32 +408,32 @@ MaxWidth="{ThemeResource TeachingTipMaxWidth}" AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"> - - + + - - + + - - + + - - + + - - + - - - - + + - - + + - - + + - - + + - 0,1,1,1 1,1,1,1 - 0,-2,0,0 - 0,0,0,-2 - -2,0,0,0 - 0,0,-2,0 + 0,-2,0,0 + 0,0,0,-2 + -2,0,0,0 + 0,0,-2,0 - 8 - 10 + 8 + 10 40 12 diff --git a/dev/TeachingTip/TestUI/TeachingTipPage.xaml b/dev/TeachingTip/TestUI/TeachingTipPage.xaml index fdf162dc05..74f2fdf2c9 100644 --- a/dev/TeachingTip/TestUI/TeachingTipPage.xaml +++ b/dev/TeachingTip/TestUI/TeachingTipPage.xaml @@ -343,17 +343,17 @@ - - - + + + - - - Auto - On - Off + + + Auto + Visible + Collapsed - + @@ -425,8 +425,8 @@ - - + + diff --git a/dev/TeachingTip/TestUI/TeachingTipPage.xaml.cs b/dev/TeachingTip/TestUI/TeachingTipPage.xaml.cs index 088bbce7ac..3342830c89 100644 --- a/dev/TeachingTip/TestUI/TeachingTipPage.xaml.cs +++ b/dev/TeachingTip/TestUI/TeachingTipPage.xaml.cs @@ -21,7 +21,7 @@ using TeachingTipClosedEventArgs = Microsoft.UI.Xaml.Controls.TeachingTipClosedEventArgs; using TeachingTipClosingEventArgs = Microsoft.UI.Xaml.Controls.TeachingTipClosingEventArgs; using TeachingTipTestHooks = Microsoft.UI.Private.Controls.TeachingTipTestHooks; -using TeachingTipPointerMode = Microsoft.UI.Xaml.Controls.TeachingTipPointerMode; +using TeachingTipTailVisibility = Microsoft.UI.Xaml.Controls.TeachingTipTailVisibility; using TeachingTipHeroContentPlacementMode = Microsoft.UI.Xaml.Controls.TeachingTipHeroContentPlacementMode; using TeachingTipPlacementMode = Microsoft.UI.Xaml.Controls.TeachingTipPlacementMode; using SymbolIconSource = Microsoft.UI.Xaml.Controls.SymbolIconSource; @@ -520,24 +520,24 @@ public void OnSetIsLightDismissEnabledButtonClicked(object sender, RoutedEventAr } } - public void OnSetTargetOffsetButtonClicked(object sender, RoutedEventArgs args) + public void OnSetPlacementMarginButtonClicked(object sender, RoutedEventArgs args) { - getTeachingTip().TargetOffset = new Thickness(Double.Parse(this.TargetOffsetTextBox.Text)); + getTeachingTip().PlacementMargin = new Thickness(Double.Parse(this.PlacementMarginTextBox.Text)); } - public void OnSetPointerModeButtonClicked(object sender, RoutedEventArgs args) + public void OnSetTailVisibilityButtonClicked(object sender, RoutedEventArgs args) { - if (this.PointerModeComboBox.SelectedItem == PointerModeAuto) + if (this.TailVisibilityComboBox.SelectedItem == TailVisibilityAuto) { - getTeachingTip().PointerMode = TeachingTipPointerMode.Auto; + getTeachingTip().TailVisibility = TeachingTipTailVisibility.Auto; } - else if (this.PointerModeComboBox.SelectedItem == PointerModeOn) + else if (this.TailVisibilityComboBox.SelectedItem == TailVisibilityVisible) { - getTeachingTip().PointerMode = TeachingTipPointerMode.On; + getTeachingTip().TailVisibility = TeachingTipTailVisibility.Visible; } else { - getTeachingTip().PointerMode = TeachingTipPointerMode.Off; + getTeachingTip().TailVisibility = TeachingTipTailVisibility.Collapsed; } } @@ -663,9 +663,9 @@ public void ContentElevationSliderChanged(object sender, RangeBaseValueChangedEv TeachingTipTestHooks.SetContentElevation(getTeachingTip(), (float)args.NewValue); } - public void PointerElevationSliderChanged(object sender, RangeBaseValueChangedEventArgs args) + public void TailElevationSliderChanged(object sender, RangeBaseValueChangedEventArgs args) { - TeachingTipTestHooks.SetPointerElevation(getTeachingTip(), (float)args.NewValue); + TeachingTipTestHooks.SetTailElevation(getTeachingTip(), (float)args.NewValue); } public void OnTipShadowChecked(object sender, RoutedEventArgs args) diff --git a/dev/TestHooks/TeachingTipTestHooks.cpp b/dev/TestHooks/TeachingTipTestHooks.cpp index 4d0c155e07..d58f162391 100644 --- a/dev/TestHooks/TeachingTipTestHooks.cpp +++ b/dev/TestHooks/TeachingTipTestHooks.cpp @@ -50,11 +50,11 @@ void TeachingTipTestHooks::SetContentElevation(const winrt::TeachingTip& teachin } } -void TeachingTipTestHooks::SetPointerElevation(const winrt::TeachingTip& teachingTip, float elevation) +void TeachingTipTestHooks::SetTailElevation(const winrt::TeachingTip& teachingTip, float elevation) { if (teachingTip) { - winrt::get_self(teachingTip)->SetPointerElevation(elevation); + winrt::get_self(teachingTip)->SetTailElevation(elevation); } } diff --git a/dev/TestHooks/TeachingTipTestHooks.h b/dev/TestHooks/TeachingTipTestHooks.h index 6e98d1d357..5e035b03a9 100644 --- a/dev/TestHooks/TeachingTipTestHooks.h +++ b/dev/TestHooks/TeachingTipTestHooks.h @@ -21,7 +21,7 @@ class TeachingTipTestHooks : static void SetContractEasingFunction(const winrt::TeachingTip& teachingTip, const winrt::CompositionEasingFunction& easingFunction); static void SetTipShouldHaveShadow(const winrt::TeachingTip& teachingTip, bool tipShadow); static void SetContentElevation(const winrt::TeachingTip& teachingTip, float elevation); - static void SetPointerElevation(const winrt::TeachingTip& teachingTip, float elevation); + static void SetTailElevation(const winrt::TeachingTip& teachingTip, float elevation); static void SetUseTestWindowBounds(const winrt::TeachingTip& teachingTip, bool useTestWindowBounds); static void SetTestWindowBounds(const winrt::TeachingTip& teachingTip, const winrt::Rect& testWindowBounds); static void SetTipFollowsTarget(const winrt::TeachingTip& teachingTIp, bool tipFollowsTarget); diff --git a/dev/TestHooks/TeachingTipTestHooks.idl b/dev/TestHooks/TeachingTipTestHooks.idl index 6a306175fc..37c36b4b52 100644 --- a/dev/TestHooks/TeachingTipTestHooks.idl +++ b/dev/TestHooks/TeachingTipTestHooks.idl @@ -7,7 +7,7 @@ runtimeclass TeachingTipTestHooks static void SetContractEasingFunction(MU_XC_NAMESPACE.TeachingTip teachingTip, Windows.UI.Composition.CompositionEasingFunction easingFunction); static void SetTipShouldHaveShadow(MU_XC_NAMESPACE.TeachingTip teachingTip, Boolean tipShouldHaveShadow); static void SetContentElevation(MU_XC_NAMESPACE.TeachingTip teachingTip, Single elevation); - static void SetPointerElevation(MU_XC_NAMESPACE.TeachingTip teachingTip, Single elevation); + static void SetTailElevation(MU_XC_NAMESPACE.TeachingTip teachingTip, Single elevation); static void SetUseTestWindowBounds(MU_XC_NAMESPACE.TeachingTip teachingTip, Boolean useTestWindowBounds); static void SetTestWindowBounds(MU_XC_NAMESPACE.TeachingTip teachingTip, Windows.Foundation.Rect testWindowBounds); static void SetTipFollowsTarget(MU_XC_NAMESPACE.TeachingTip teachingTip, Boolean tipFollowsTarget);