Skip to content

Commit

Permalink
Fix CommandBarFlyout not having shadows (#5234)
Browse files Browse the repository at this point in the history
* Fix CommandBarFlyout not having shadows since drop shadows now require translation to be set.

* Fix down level build break.
  • Loading branch information
StephenLPeters authored Jun 22, 2021
1 parent 4d9d005 commit 3844707
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dev/CommandBarFlyout/CommandBarFlyout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ winrt::Control CommandBarFlyout::CreatePresenter()
presenter.BorderThickness(winrt::ThicknessHelper::FromUniformLength(0));
presenter.Padding(winrt::ThicknessHelper::FromUniformLength(0));
presenter.Content(*commandBar);
if (SharedHelpers::IsRS5OrHigher())
{
presenter.Translation({ 0.0f, 0.0f, 32.0f });
}

// Disable the default shadow, as we'll be providing our own shadow.
if (winrt::IFlyoutPresenter2 presenter2 = presenter)
Expand Down
3 changes: 2 additions & 1 deletion dev/CommandBarFlyout/CommandBarFlyout_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,8 @@
<Grid
x:Name="OuterOverflowContentRootV2"
RequestedTheme="{TemplateBinding ActualTheme}"
Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=FlyoutTemplateSettings.ExpandedWidth}">
Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=FlyoutTemplateSettings.ExpandedWidth}"
contract7Present:Translation="0,0,32">
<Grid.RenderTransform>
<TranslateTransform
x:Name="OverflowContentRootTransform"
Expand Down

0 comments on commit 3844707

Please sign in to comment.