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 for widgets and sidebar #12684

Merged
merged 2 commits into from
Jun 22, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Files.App/Helpers/ShellContextMenuHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,13 @@ public static async Task LoadShellMenuItems(
if (openWithItem is not null)
shellMenuItems.Remove(openWithItem);

var sendToItem = showSendToMenu ? shellMenuItems.Where(x => (x.Tag as Win32ContextMenuItem)?.CommandString == "sendto").ToList().FirstOrDefault() : null;
if (sendToItem is not null)
var sendToItem = shellMenuItems.Where(x => (x.Tag as Win32ContextMenuItem)?.CommandString == "sendto").ToList().FirstOrDefault();
if (sendToItem is not null &&
(showSendToMenu || !UserSettingsService.GeneralSettingsService.ShowSendToMenu))
shellMenuItems.Remove(sendToItem);
yaira2 marked this conversation as resolved.
Show resolved Hide resolved

sendToItem = showSendToMenu && UserSettingsService.GeneralSettingsService.ShowSendToMenu ? sendToItem : null;

if (!UserSettingsService.GeneralSettingsService.MoveShellExtensionsToSubMenu)
{
var (_, secondaryElements) = ItemModelListToContextFlyoutHelper.GetAppBarItemsFromModel(shellMenuItems);
Expand Down Expand Up @@ -328,7 +331,7 @@ public static async Task LoadShellMenuItems(
}

// Add items to sendto dropdown
if (sendToItem?.LoadSubMenuAction is not null && UserSettingsService.GeneralSettingsService.ShowSendToMenu)
if (sendToItem?.LoadSubMenuAction is not null)
{
await sendToItem.LoadSubMenuAction();

Expand Down
3 changes: 1 addition & 2 deletions src/Files.App/UserControls/Widgets/FileTagsWidget.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ private async void AdaptiveGridView_RightTapped(object sender, RightTappedRouted
ItemContextMenuFlyout = itemContextMenuFlyout;
itemContextMenuFlyout.ShowAt(element, new FlyoutShowOptions { Position = e.GetPosition(element) });

var showSendTo = userSettingsService.GeneralSettingsService.ShowSendToMenu;
await ShellContextmenuHelper.LoadShellMenuItems(item.Path, itemContextMenuFlyout, showOpenWithMenu: true, showSendToMenu: showSendTo);
await ShellContextmenuHelper.LoadShellMenuItems(item.Path, itemContextMenuFlyout, showOpenWithMenu: true, showSendToMenu: true);
e.Handled = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public override List<ContextMenuFlyoutItemViewModel> GetItemMenuItems(WidgetCard
Tag = "ItemOverflow",
IsEnabled = false,
}
};
}.Where(x => x.ShowItem).ToList();
}

public async Task RefreshWidget()
Expand Down