Skip to content

Commit 93566ce

Browse files
authored
Fix: Fixed issue where Open with and Send To submenus didn't appear properly in Widgets (#14879)
1 parent 59f5925 commit 93566ce

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/Files.App/Data/Factories/ShellContextFlyoutHelper.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ x.Tag is Win32ContextMenuItem menuItem &&
272272
if (manageBitLocker is not null)
273273
shellMenuItems.Remove(manageBitLocker);
274274

275+
var lastItem = shellMenuItems.LastOrDefault();
276+
while (lastItem?.ItemType is ContextMenuFlyoutItemType.Separator)
277+
{
278+
shellMenuItems.Remove(lastItem);
279+
lastItem = shellMenuItems.LastOrDefault();
280+
}
281+
275282
ContentPageContextFlyoutFactory.SwapPlaceholderWithShellOption(
276283
itemContextMenuFlyout,
277284
"ManageBitLockerPlaceholder",

src/Files.App/UserControls/Widgets/FileTagsWidget.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private void AdaptiveGridView_RightTapped(object sender, RightTappedRoutedEventA
140140
itemContextMenuFlyout.ShowAt(element, new() { Position = e.GetPosition(element) });
141141

142142
// Load shell menu items
143-
_ = ShellContextFlyoutFactory.LoadShellMenuItemsAsync(_flyoutItemPath, itemContextMenuFlyout);
143+
_ = ShellContextFlyoutFactory.LoadShellMenuItemsAsync(_flyoutItemPath, itemContextMenuFlyout, null, true, true);
144144

145145
e.Handled = true;
146146
}

src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private void ListView_RightTapped(object sender, RightTappedRoutedEventArgs e)
142142
itemContextMenuFlyout.ShowAt(element, new() { Position = e.GetPosition(element) });
143143

144144
// Load shell menu items
145-
_ = ShellContextFlyoutFactory.LoadShellMenuItemsAsync(_flyoutItemPath, itemContextMenuFlyout);
145+
_ = ShellContextFlyoutFactory.LoadShellMenuItemsAsync(_flyoutItemPath, itemContextMenuFlyout, null, true, true);
146146
}
147147

148148
public override List<ContextMenuFlyoutItemViewModel> GetItemMenuItems(WidgetCardItem item, bool isPinned, bool isFolder = false)

0 commit comments

Comments
 (0)