diff --git a/src/Files.App/BaseLayout.cs b/src/Files.App/BaseLayout.cs index 31c3bc076d88..30c74375d539 100644 --- a/src/Files.App/BaseLayout.cs +++ b/src/Files.App/BaseLayout.cs @@ -72,11 +72,15 @@ public AppModel AppModel public CommandBarFlyout ItemContextMenuFlyout { get; set; } = new() { AlwaysExpanded = true, + AreOpenCloseAnimationsEnabled = false, + Placement = FlyoutPlacementMode.RightEdgeAlignedTop, }; public CommandBarFlyout BaseContextMenuFlyout { get; set; } = new() { AlwaysExpanded = true, + AreOpenCloseAnimationsEnabled = false, + Placement = FlyoutPlacementMode.RightEdgeAlignedTop, }; public BaseLayoutCommandsViewModel? CommandsViewModel { get; protected set; } @@ -645,9 +649,9 @@ private async Task LoadMenuItemsAsync() ItemContextMenuFlyout.SecondaryCommands.Clear(); var (primaryElements, secondaryElements) = ItemModelListToContextFlyoutHelper.GetAppBarItemsFromModel(items); AddCloseHandler(ItemContextMenuFlyout, primaryElements, secondaryElements); - primaryElements.ForEach(i => ItemContextMenuFlyout.PrimaryCommands.Add(i)); + primaryElements.ForEach(ItemContextMenuFlyout.PrimaryCommands.Add); secondaryElements.OfType().ForEach(i => i.MinWidth = Constants.UI.ContextMenuItemsMaxWidth); // Set menu min width - secondaryElements.ForEach(i => ItemContextMenuFlyout.SecondaryCommands.Add(i)); + secondaryElements.ForEach(ItemContextMenuFlyout.SecondaryCommands.Add); if (InstanceViewModel!.CanTagFilesInPage) AddNewFileTagsToMenu(ItemContextMenuFlyout); @@ -756,11 +760,13 @@ private void AddShellItemsToMenu(List shellMenuI index++; } - if (overflowItemFlyout.Items.Count > 0) + if (overflowItemFlyout.Items.Count > 0 && UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu) { - (contextMenuFlyout.SecondaryCommands.First(x => x is FrameworkElement fe && fe.Tag as string == "OverflowSeparator") as AppBarSeparator)!.Visibility = Visibility.Visible; - overflowItem.Visibility = Visibility.Visible; + overflowItem.Label = "ShowMoreOptions".GetLocalizedResource(); + overflowItem.IsEnabled = true; } + else if (!UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu) + overflowItem.Visibility = Visibility.Collapsed; } } else diff --git a/src/Files.App/Helpers/ContextFlyoutItemHelper.cs b/src/Files.App/Helpers/ContextFlyoutItemHelper.cs index ba471000d242..bd110d8c5658 100644 --- a/src/Files.App/Helpers/ContextFlyoutItemHelper.cs +++ b/src/Files.App/Helpers/ContextFlyoutItemHelper.cs @@ -641,12 +641,12 @@ public static List GetBaseLayoutMenuItems(Curren }, new ContextMenuFlyoutItemViewModel() { - Text = "ShowMoreOptions".GetLocalizedResource(), + Text = "LoadingMoreOptions".GetLocalizedResource(), Glyph = "\xE712", Items = new List(), ID = "ItemOverflow", Tag = "ItemOverflow", - IsHidden = true, + IsEnabled = false, }, }; } @@ -1106,17 +1106,16 @@ public static List GetBaseItemMenuItems(BaseLayo ItemType = ItemType.Separator, Tag = "OverflowSeparator", ShowInSearchPage = true, - IsHidden = true, }, new ContextMenuFlyoutItemViewModel() { - Text = "ShowMoreOptions".GetLocalizedResource(), + Text = "LoadingMoreOptions".GetLocalizedResource(), Glyph = "\xE712", Items = new List(), ID = "ItemOverflow", Tag = "ItemOverflow", ShowInSearchPage = true, - IsHidden = true, + IsEnabled = false }, }; } diff --git a/src/Files.App/Helpers/ShellContextMenuHelper.cs b/src/Files.App/Helpers/ShellContextMenuHelper.cs index 1b596af13851..173fb0c8234f 100644 --- a/src/Files.App/Helpers/ShellContextMenuHelper.cs +++ b/src/Files.App/Helpers/ShellContextMenuHelper.cs @@ -288,6 +288,9 @@ public static async Task LoadShellMenuItems(string path, CommandBarFlyout itemCo if (flyoutItems is not null) overflowItems.ForEach(i => flyoutItems.Add(i)); overflowItem.Visibility = overflowItems.Any() ? Visibility.Visible : Visibility.Collapsed; + + overflowItem.Label = "ShowMoreOptions".GetLocalizedResource(); + overflowItem.IsEnabled = true; } } catch { } diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index e98b694e4a7f..df97658c0293 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2928,4 +2928,7 @@ Never + + Loading more options... + \ No newline at end of file diff --git a/src/Files.App/UserControls/SidebarControl.xaml.cs b/src/Files.App/UserControls/SidebarControl.xaml.cs index c7dd5d4e7dc5..0cb8e2aac916 100644 --- a/src/Files.App/UserControls/SidebarControl.xaml.cs +++ b/src/Files.App/UserControls/SidebarControl.xaml.cs @@ -276,12 +276,13 @@ private List GetLocationItemMenuItems(INavigatio }, new ContextMenuFlyoutItemViewModel() { - Text = "ShowMoreOptions".GetLocalizedResource(), + Text = "LoadingMoreOptions".GetLocalizedResource(), Glyph = "\xE712", Items = new List(), ID = "ItemOverflow", Tag = "ItemOverflow", - IsHidden = true, + IsEnabled = false, + IsHidden = !options.ShowShellItems, } }.Where(x => x.ShowItem).ToList(); } diff --git a/src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs b/src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs index dd840277fcca..06e78e064982 100644 --- a/src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs +++ b/src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs @@ -206,12 +206,12 @@ public override List GetItemMenuItems(WidgetCard }, new ContextMenuFlyoutItemViewModel() { - Text = "ShowMoreOptions".GetLocalizedResource(), + Text = "LoadingMoreOptions".GetLocalizedResource(), Glyph = "\xE712", Items = new List(), ID = "ItemOverflow", Tag = "ItemOverflow", - IsHidden = true + IsEnabled = false, } }.Where(x => x.ShowItem).ToList(); } diff --git a/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml.cs b/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml.cs index a1fbc3dba320..736b254c2d3a 100644 --- a/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml.cs +++ b/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml.cs @@ -228,12 +228,12 @@ public override List GetItemMenuItems(WidgetCard }, new ContextMenuFlyoutItemViewModel() { - Text = "ShowMoreOptions".GetLocalizedResource(), + Text = "LoadingMoreOptions".GetLocalizedResource(), Glyph = "\xE712", Items = new List(), ID = "ItemOverflow", Tag = "ItemOverflow", - IsHidden = true + IsEnabled = false, } }.Where(x => x.ShowItem).ToList(); } diff --git a/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs b/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs index 3260bb047cee..de2f2f015039 100644 --- a/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs +++ b/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs @@ -153,12 +153,12 @@ public override List GetItemMenuItems(WidgetCard }, new ContextMenuFlyoutItemViewModel() { - Text = "ShowMoreOptions".GetLocalizedResource(), + Text = "LoadingMoreOptions".GetLocalizedResource(), Glyph = "\xE712", Items = new List(), ID = "ItemOverflow", Tag = "ItemOverflow", - IsHidden = true + IsEnabled = false, } }; }