Skip to content
Merged
22 changes: 11 additions & 11 deletions src/Files.App/Views/PaneHolderPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Navigation;
using System.Runtime.CompilerServices;
using Windows.System;

namespace Files.App.Views
{
Expand Down Expand Up @@ -364,23 +363,24 @@ private void SetShadow()
if (IsMultiPaneActive)
{
// Add theme shadow to the active pane
if (IsLeftPaneActive)
if (PaneRight is not null)
{
if (PaneRight is not null)
PaneRight.RootGrid.Translation = new System.Numerics.Vector3(0, 0, 0);
if (PaneLeft is not null)
PaneLeft.RootGrid.Translation = new System.Numerics.Vector3(0, 0, 32);
PaneRight.RootGrid.Translation = new System.Numerics.Vector3(0, 0, IsLeftPaneActive ? 0 : 32);
VisualStateManager.GoToState(PaneLeft, IsLeftPaneActive ? "ShellBorderFocusOnState" : "ShellBorderFocusOffState", true);
}
else

if (PaneLeft is not null)
{
if (PaneRight is not null)
PaneRight.RootGrid.Translation = new System.Numerics.Vector3(0, 0, 32);
if (PaneLeft is not null)
PaneLeft.RootGrid.Translation = new System.Numerics.Vector3(0, 0, 0);
PaneLeft.RootGrid.Translation = new System.Numerics.Vector3(0, 0, IsLeftPaneActive ? 32 : 0);
VisualStateManager.GoToState(PaneRight, IsLeftPaneActive ? "ShellBorderFocusOffState" : "ShellBorderFocusOnState", true);
}
}
else
{
PaneLeft.RootGrid.Translation = new System.Numerics.Vector3(0, 0, 8);

VisualStateManager.GoToState(PaneLeft, "ShellBorderDualPaneOffState", true);
}
}

private void Pane_RightTapped(object sender, RoutedEventArgs e)
Expand Down
34 changes: 34 additions & 0 deletions src/Files.App/Views/Shells/ModernShellPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@
Loaded="Page_Loaded"
mc:Ignorable="d">

<local:BaseShellPage.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<Thickness x:Key="Local.ActivePane.BorderThickness">1</Thickness>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<Thickness x:Key="Local.ActivePane.BorderThickness">1</Thickness>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<Thickness x:Key="Local.ActivePane.BorderThickness">3</Thickness>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</local:BaseShellPage.Resources>

<local:BaseShellPage.KeyboardAccelerators>
<KeyboardAccelerator
Key="V"
Expand Down Expand Up @@ -80,6 +96,24 @@
Navigated="ItemDisplayFrame_Navigated" />

<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ShellBorderFocusState">
<VisualState x:Name="ShellBorderFocusOnState">
<VisualState.Setters>
<Setter Target="RootGrid.BorderThickness" Value="{ThemeResource Local.ActivePane.BorderThickness}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="ShellBorderFocusOffState">
<VisualState.Setters>
<Setter Target="RootGrid.BorderThickness" Value="1" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="ShellBorderDualPaneOffState">
<VisualState.Setters>
<Setter Target="RootGrid.BorderThickness" Value="1" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>

<VisualStateGroup x:Name="ShellBackgroundFocusState">
<VisualState x:Name="ShellBackgroundFocusOnState">
<VisualState.Setters>
Expand Down