diff --git a/src/Files.App/MainWindow.xaml.cs b/src/Files.App/MainWindow.xaml.cs index 534f7cb7dc5c..bed178f48d13 100644 --- a/src/Files.App/MainWindow.xaml.cs +++ b/src/Files.App/MainWindow.xaml.cs @@ -207,10 +207,12 @@ async Task PerformNavigation(string payload, string selectItem = null) payload = folder.Path; // Convert short name to long name (#6190) } + var generalSettingsService = Ioc.Default.GetService(); var paneNavigationArgs = new PaneNavigationArguments { LeftPaneNavPathParam = payload, LeftPaneSelectItemParam = selectItem, + RightPaneNavPathParam = Bounds.Width > PaneHolderPage.DualPaneWidthThreshold && (generalSettingsService?.AlwaysOpenDualPaneInNewTab ?? false) ? "Home" : null, }; if (rootFrame.Content is not null) diff --git a/src/Files.App/Views/PaneHolderPage.xaml.cs b/src/Files.App/Views/PaneHolderPage.xaml.cs index 52867dbd0d96..1a679e476537 100644 --- a/src/Files.App/Views/PaneHolderPage.xaml.cs +++ b/src/Files.App/Views/PaneHolderPage.xaml.cs @@ -14,6 +14,8 @@ namespace Files.App.Views { public sealed partial class PaneHolderPage : Page, IPaneHolder, ITabItemContent { + public static readonly int DualPaneWidthThreshold = 750; + public static event EventHandler? CurrentInstanceChanged; private IUserSettingsService UserSettingsService { get; } @@ -46,7 +48,7 @@ public TabItemArguments TabItemArguments } } - private bool _WindowIsCompact = MainWindow.Instance.Bounds.Width <= 750; + private bool _WindowIsCompact = MainWindow.Instance.Bounds.Width <= DualPaneWidthThreshold; public bool WindowIsCompact { get => _WindowIsCompact; @@ -78,7 +80,7 @@ public bool IsMultiPaneActive => IsRightPaneVisible; public bool IsMultiPaneEnabled - => !(MainWindow.Instance.Bounds.Width <= 750); + => MainWindow.Instance.Bounds.Width > DualPaneWidthThreshold; private NavigationParams _NavParamsLeft; public NavigationParams NavParamsLeft @@ -208,7 +210,7 @@ public PaneHolderPage() private void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e) { - WindowIsCompact = MainWindow.Instance.Bounds.Width <= 750; + WindowIsCompact = MainWindow.Instance.Bounds.Width <= DualPaneWidthThreshold; } protected override void OnNavigatedTo(NavigationEventArgs eventArgs)