diff --git a/Screenbox/Controls/CustomNavigationView.cs b/Screenbox/Controls/CustomNavigationView.cs index 18989d4a6..e9aee0b88 100644 --- a/Screenbox/Controls/CustomNavigationView.cs +++ b/Screenbox/Controls/CustomNavigationView.cs @@ -3,7 +3,6 @@ using CommunityToolkit.WinUI; using CommunityToolkit.WinUI.Animations; using System; -using System.Numerics; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Input; @@ -71,7 +70,8 @@ public UIElement? OverlayContent set => SetValue(OverlayContentProperty, value); } - private Border? _overlayRoot; + private Grid? _overlayRoot; + private Border? _overlayContentHost; private Border? _contentBackground; private SplitView? _splitView; private Grid? _paneToggleButtonGrid; @@ -90,11 +90,6 @@ protected override void OnApplyTemplate() _paneToggleButtonGrid = (Grid?)GetTemplateChild("PaneToggleButtonGrid"); _contentGrid = (Grid?)GetTemplateChild("ContentGrid"); _paneContentGrid = (Grid?)GetTemplateChild("PaneContentGrid"); - Grid? shadowCaster = (Grid?)GetTemplateChild("ShadowCaster"); - if (shadowCaster != null) - { - shadowCaster.Translation = new Vector3(0, 0, 32); - } if (_splitView != null) { @@ -124,12 +119,17 @@ protected override void OnKeyDown(KeyRoutedEventArgs e) private void OnLoaded(object sender, RoutedEventArgs e) { - if (_splitView?.FindDescendant(b => b.Name == "OverlayRoot") is { } overlayRoot) + if (_splitView?.FindDescendant(b => b.Name == "OverlayRoot") is { } overlayRoot) { _overlayRoot = overlayRoot; overlayRoot.Tapped += OverlayRootOnTapped; - overlayRoot.Child = OverlayContent; Canvas.SetZIndex(overlayRoot, OverlayZIndex); + + if (overlayRoot.FindDescendant(b => b.Name == "OverlayContentHost") is { } overlayContentHost) + { + _overlayContentHost = overlayContentHost; + overlayContentHost.Child = OverlayContent; + } } if (_splitView?.FindDescendant(b => b.Name == "ContentBackground") is { } contentBackground) @@ -180,9 +180,9 @@ private static void OnContentVisibilityChanged(DependencyObject d, DependencyPro private static void OnOverlayContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { CustomNavigationView view = (CustomNavigationView)d; - if (view._overlayRoot != null) + if (view._overlayContentHost != null) { - view._overlayRoot.Child = (UIElement)e.NewValue; + view._overlayContentHost.Child = (UIElement)e.NewValue; } } diff --git a/Screenbox/Controls/Styles/CustomSplitView.xaml b/Screenbox/Controls/Styles/CustomSplitView.xaml index 0dbcfa8c1..4d0e21a25 100644 --- a/Screenbox/Controls/Styles/CustomSplitView.xaml +++ b/Screenbox/Controls/Styles/CustomSplitView.xaml @@ -78,18 +78,20 @@ Background="{ThemeResource SplitViewContentBackground}" BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" /> - - + Grid.ColumnSpan="2"> + + + diff --git a/Screenbox/Pages/MainPage.xaml b/Screenbox/Pages/MainPage.xaml index daad9d2bd..2e7647430 100644 --- a/Screenbox/Pages/MainPage.xaml +++ b/Screenbox/Pages/MainPage.xaml @@ -21,8 +21,9 @@ - 0,48,0,0 + 0,34,0,0 0,48,0,0 + 16,30,16,30 0,0,0,0 0,0,0,0 0,0,0,0 @@ -52,7 +53,8 @@ x:Name="AppTitleBar" Height="48" VerticalAlignment="Top" - Canvas.ZIndex="1"> + Canvas.ZIndex="1" + Visibility="Collapsed">