Skip to content

Commit a1cf0db

Browse files
authored
Fix: Fixed issue where opening folders from external source didn't honor the dual pane settings (#13014)
1 parent f6a7445 commit a1cf0db

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Files.App/MainWindow.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,12 @@ async Task PerformNavigation(string payload, string selectItem = null)
207207
payload = folder.Path; // Convert short name to long name (#6190)
208208
}
209209

210+
var generalSettingsService = Ioc.Default.GetService<IGeneralSettingsService>();
210211
var paneNavigationArgs = new PaneNavigationArguments
211212
{
212213
LeftPaneNavPathParam = payload,
213214
LeftPaneSelectItemParam = selectItem,
215+
RightPaneNavPathParam = Bounds.Width > PaneHolderPage.DualPaneWidthThreshold && (generalSettingsService?.AlwaysOpenDualPaneInNewTab ?? false) ? "Home" : null,
214216
};
215217

216218
if (rootFrame.Content is MainPage)

src/Files.App/Views/PaneHolderPage.xaml.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ namespace Files.App.Views
1414
{
1515
public sealed partial class PaneHolderPage : Page, IPaneHolder, ITabItemContent
1616
{
17+
public static readonly int DualPaneWidthThreshold = 750;
18+
1719
public static event EventHandler<PaneHolderPage>? CurrentInstanceChanged;
1820

1921
private IUserSettingsService UserSettingsService { get; }
@@ -46,7 +48,7 @@ public TabItemArguments TabItemArguments
4648
}
4749
}
4850

49-
private bool _WindowIsCompact = MainWindow.Instance.Bounds.Width <= 750;
51+
private bool _WindowIsCompact = MainWindow.Instance.Bounds.Width <= DualPaneWidthThreshold;
5052
public bool WindowIsCompact
5153
{
5254
get => _WindowIsCompact;
@@ -78,7 +80,7 @@ public bool IsMultiPaneActive
7880
=> IsRightPaneVisible;
7981

8082
public bool IsMultiPaneEnabled
81-
=> !(MainWindow.Instance.Bounds.Width <= 750);
83+
=> MainWindow.Instance.Bounds.Width > DualPaneWidthThreshold;
8284

8385
private NavigationParams _NavParamsLeft;
8486
public NavigationParams NavParamsLeft
@@ -208,7 +210,7 @@ public PaneHolderPage()
208210

209211
private void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e)
210212
{
211-
WindowIsCompact = MainWindow.Instance.Bounds.Width <= 750;
213+
WindowIsCompact = MainWindow.Instance.Bounds.Width <= DualPaneWidthThreshold;
212214
}
213215

214216
protected override void OnNavigatedTo(NavigationEventArgs eventArgs)

0 commit comments

Comments
 (0)