Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Files.App/Actions/FileSystem/OpenItemAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public HotKey HotKey
public bool IsExecutable =>
context.HasSelection &&
!(context.ShellPage is ColumnShellPage &&
context.SelectedItem?.PrimaryItemAttribute == StorageItemTypes.Folder);
context.SelectedItem?.PrimaryItemAttribute == StorageItemTypes.Folder) &&
!(context.PageType == ContentPageTypes.RecycleBin &&
context.SelectedItems.All(x => x.IsFolder));

public OpenItemAction()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public string Description
=> Strings.OpenDirectoryInNewPaneDescription.GetLocalizedResource();

public virtual bool IsExecutable =>
ContentPageContext.PageType != ContentPageTypes.RecycleBin &&
ContentPageContext.SelectedItem is not null &&
ContentPageContext.SelectedItem.IsFolder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public virtual bool IsAccessibleGlobally
public virtual bool IsExecutable =>
ContentPageContext.ShellPage is not null &&
ContentPageContext.ShellPage.SlimContentPage is not null &&
ContentPageContext.PageType != ContentPageTypes.RecycleBin &&
ContentPageContext.SelectedItems.Count is not 0 &&
ContentPageContext.SelectedItems.Count <= 5 &&
ContentPageContext.SelectedItems.Count(x => x.IsFolder) == ContentPageContext.SelectedItems.Count;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public virtual bool IsAccessibleGlobally
public virtual bool IsExecutable =>
ContentPageContext.ShellPage is not null &&
ContentPageContext.ShellPage.SlimContentPage is not null &&
ContentPageContext.PageType != ContentPageTypes.RecycleBin &&
ContentPageContext.SelectedItems.Count is not 0 &&
ContentPageContext.SelectedItems.Count <= 5 &&
ContentPageContext.SelectedItems.Count(x => x.IsFolder) == ContentPageContext.SelectedItems.Count;
Expand Down
13 changes: 8 additions & 5 deletions src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
{
IsVisible = currentInstanceViewModel.IsPageTypeRecycleBin && itemsSelected,
}.Build(),
new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenItem).Build(),
new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenItem)
{
IsVisible = !(currentInstanceViewModel.IsPageTypeRecycleBin && areAllItemsFolders)
}.Build(),
new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenItemWithApplicationPicker)
{
Tag = "OpenWith",
Expand Down Expand Up @@ -409,15 +412,15 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenFileLocation).Build(),
new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenInNewTab)
{
IsVisible = UserSettingsService.GeneralSettingsService.ShowOpenInNewTab && Commands.OpenInNewTab.IsExecutable
IsVisible = UserSettingsService.GeneralSettingsService.ShowOpenInNewTab && Commands.OpenInNewTab.IsExecutable && !currentInstanceViewModel.IsPageTypeRecycleBin
}.Build(),
new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenInNewWindow)
{
IsVisible = UserSettingsService.GeneralSettingsService.ShowOpenInNewWindow && Commands.OpenInNewWindow.IsExecutable
IsVisible = UserSettingsService.GeneralSettingsService.ShowOpenInNewWindow && Commands.OpenInNewWindow.IsExecutable && !currentInstanceViewModel.IsPageTypeRecycleBin
}.Build(),
new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenInNewPane)
{
IsVisible = UserSettingsService.GeneralSettingsService.ShowOpenInNewPane && Commands.OpenInNewPane.IsExecutable
IsVisible = UserSettingsService.GeneralSettingsService.ShowOpenInNewPane && Commands.OpenInNewPane.IsExecutable && !currentInstanceViewModel.IsPageTypeRecycleBin
}.Build(),
new ContextMenuFlyoutItemViewModel()
{
Expand Down Expand Up @@ -479,7 +482,7 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
}.Build(),
new ContextMenuFlyoutItemViewModelBuilder(Commands.CreateFolderWithSelection)
{
IsVisible = UserSettingsService.GeneralSettingsService.ShowCreateFolderWithSelection && itemsSelected
IsVisible = UserSettingsService.GeneralSettingsService.ShowCreateFolderWithSelection && itemsSelected && !currentInstanceViewModel.IsPageTypeRecycleBin
}.Build(),
new ContextMenuFlyoutItemViewModelBuilder(Commands.CreateShortcut)
{
Expand Down
Loading