Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixed issue where opening folders from external sources didn't honor the dual pane settings #13014

Merged
merged 1 commit into from Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Files.App/MainWindow.xaml.cs
Expand Up @@ -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<IGeneralSettingsService>();
var paneNavigationArgs = new PaneNavigationArguments
{
LeftPaneNavPathParam = payload,
LeftPaneSelectItemParam = selectItem,
RightPaneNavPathParam = Bounds.Width > PaneHolderPage.DualPaneWidthThreshold && (generalSettingsService?.AlwaysOpenDualPaneInNewTab ?? false) ? "Home" : null,
};

if (rootFrame.Content is not null)
Expand Down
8 changes: 5 additions & 3 deletions src/Files.App/Views/PaneHolderPage.xaml.cs
Expand Up @@ -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<PaneHolderPage>? CurrentInstanceChanged;

private IUserSettingsService UserSettingsService { get; }
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down