Skip to content

Commit e9806b6

Browse files
authored
Feature: Move shell extensions to sub menu by default (#11110)
1 parent 688d889 commit e9806b6

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

src/Files.App/BaseLayout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ private void AddNewFileTagsToMenu(CommandBarFlyout contextMenu)
635635
private void AddShellItemsToMenu(List<ContextMenuFlyoutItemViewModel> shellMenuItems, CommandBarFlyout contextMenuFlyout, bool shiftPressed)
636636
{
637637
var openWithSubItems = ItemModelListToContextFlyoutHelper.GetMenuFlyoutItemsFromModel(ShellContextmenuHelper.GetOpenWithItems(shellMenuItems));
638-
var mainShellMenuItems = shellMenuItems.RemoveFrom(!UserSettingsService.AppearanceSettingsService.MoveOverflowMenuItemsToSubMenu ? int.MaxValue : shiftPressed ? 6 : 4);
638+
var mainShellMenuItems = shellMenuItems.RemoveFrom(!UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu ? int.MaxValue : shiftPressed ? 6 : 0);
639639
var overflowShellMenuItems = shellMenuItems.Except(mainShellMenuItems).ToList();
640640

641641
var overflowItems = ItemModelListToContextFlyoutHelper.GetMenuFlyoutItemsFromModel(overflowShellMenuItems);

src/Files.App/Helpers/ContextFlyoutItemHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static List<ContextMenuFlyoutItemViewModel> Filter(List<ContextMenuFlyout
5555
var overflow = items.Where(x => x.ID == "ItemOverflow").FirstOrDefault();
5656
if (overflow is not null)
5757
{
58-
if (!shiftPressed && userSettingsService.AppearanceSettingsService.MoveOverflowMenuItemsToSubMenu) // items with ShowOnShift to overflow menu
58+
if (!shiftPressed && userSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu) // items with ShowOnShift to overflow menu
5959
{
6060
var overflowItems = items.Where(x => x.ShowOnShift).ToList();
6161

@@ -609,7 +609,7 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseLayoutMenuItems(Curren
609609
},
610610
new ContextMenuFlyoutItemViewModel()
611611
{
612-
Text = "ContextMenuMoreItemsLabel".GetLocalizedResource(),
612+
Text = "ShowMoreOptions".GetLocalizedResource(),
613613
Glyph = "\xE712",
614614
Items = new List<ContextMenuFlyoutItemViewModel>(),
615615
ID = "ItemOverflow",
@@ -1074,7 +1074,7 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayo
10741074
},
10751075
new ContextMenuFlyoutItemViewModel()
10761076
{
1077-
Text = "ContextMenuMoreItemsLabel".GetLocalizedResource(),
1077+
Text = "ShowMoreOptions".GetLocalizedResource(),
10781078
Glyph = "\xE712",
10791079
Items = new List<ContextMenuFlyoutItemViewModel>(),
10801080
ID = "ItemOverflow",

src/Files.App/Helpers/ShellContextMenuHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static void LoadMenuFlyoutItem(IList<ContextMenuFlyoutItemViewModel> menu
8888
{
8989
var menuLayoutSubItem = new ContextMenuFlyoutItemViewModel()
9090
{
91-
Text = "ContextMenuMoreItemsLabel".GetLocalizedResource(),
91+
Text = "ShowMoreOptions".GetLocalizedResource(),
9292
Glyph = "\xE712",
9393
};
9494
LoadMenuFlyoutItem(menuLayoutSubItem.Items, contextMenu, overflowItems, cancellationToken, showIcons);

src/Files.App/ServicesImplementation/Settings/AppearanceSettingsService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public bool IsSidebarOpen
2626
set => Set(value);
2727
}
2828

29-
public bool MoveOverflowMenuItemsToSubMenu
29+
public bool MoveShellExtensionsToSubMenu
3030
{
3131
get => Get(true);
3232
set => Set(value);
@@ -77,7 +77,7 @@ protected override void RaiseOnSettingChangedEvent(object sender, SettingChanged
7777
{
7878
switch (e.SettingName)
7979
{
80-
case nameof(MoveOverflowMenuItemsToSubMenu):
80+
case nameof(MoveShellExtensionsToSubMenu):
8181
case nameof(UseCompactStyles):
8282
case nameof(AppThemeBackgroundColor):
8383
case nameof(AppThemeAddressBarBackgroundColor):

src/Files.App/Strings/en-US/Resources.resw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,8 @@
738738
<data name="RenameError.TooLong.Title" xml:space="preserve">
739739
<value>Item name was too long</value>
740740
</data>
741-
<data name="ContextMenuMoreItemsLabel" xml:space="preserve">
742-
<value>More</value>
741+
<data name="ShowMoreOptions" xml:space="preserve">
742+
<value>Show more options</value>
743743
</data>
744744
<data name="RestartNotificationText.Text" xml:space="preserve">
745745
<value>The application needs to be restarted in order to apply these settings, would you like to restart the app?</value>

src/Files.App/UserControls/SidebarControl.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ private List<ContextMenuFlyoutItemViewModel> GetLocationItemMenuItems(INavigatio
316316
},
317317
new ContextMenuFlyoutItemViewModel()
318318
{
319-
Text = "ContextMenuMoreItemsLabel".GetLocalizedResource(),
319+
Text = "ShowMoreOptions".GetLocalizedResource(),
320320
Glyph = "\xE712",
321321
Items = new List<ContextMenuFlyoutItemViewModel>(),
322322
ID = "ItemOverflow",
@@ -498,7 +498,7 @@ private void NavigationViewItem_RightTapped(object sender, RightTappedRoutedEven
498498
var menuItems = GetLocationItemMenuItems(item, itemContextMenuFlyout);
499499
var (_, secondaryElements) = ItemModelListToContextFlyoutHelper.GetAppBarItemsFromModel(menuItems);
500500

501-
if (!UserSettingsService.AppearanceSettingsService.MoveOverflowMenuItemsToSubMenu)
501+
if (!UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu)
502502
secondaryElements.OfType<FrameworkElement>()
503503
.ForEach(i => i.MinWidth = Constants.UI.ContextMenuItemsMaxWidth); // Set menu min width if the overflow menu setting is disabled
504504

@@ -1056,7 +1056,7 @@ private async void LoadShellMenuItems(CommandBarFlyout itemContextMenuFlyout, Co
10561056
var shiftPressed = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down);
10571057
var shellMenuItems = await ContextFlyoutItemHelper.GetItemContextShellCommandsAsync(currentInstanceViewModel: null, workingDir: null,
10581058
new List<ListedItem>() { new ListedItem(null) { ItemPath = rightClickedItem.Path } }, shiftPressed: shiftPressed, showOpenMenu: false, default);
1059-
if (!UserSettingsService.AppearanceSettingsService.MoveOverflowMenuItemsToSubMenu)
1059+
if (!UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu)
10601060
{
10611061
var (_, secondaryElements) = ItemModelListToContextFlyoutHelper.GetAppBarItemsFromModel(shellMenuItems);
10621062
if (!secondaryElements.Any())

src/Files.App/ViewModels/SettingsViewModels/AppearanceViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ public ElementTheme SelectedElementTheme
9595
get => (ElementTheme)selectedThemeIndex;
9696
}
9797

98-
public bool MoveOverflowMenuItemsToSubMenu
98+
public bool MoveShellExtensionsToSubMenu
9999
{
100-
get => UserSettingsService.AppearanceSettingsService.MoveOverflowMenuItemsToSubMenu;
100+
get => UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu;
101101
set
102102
{
103-
if (value != UserSettingsService.AppearanceSettingsService.MoveOverflowMenuItemsToSubMenu)
103+
if (value != UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu)
104104
{
105-
UserSettingsService.AppearanceSettingsService.MoveOverflowMenuItemsToSubMenu = value;
105+
UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu = value;
106106
OnPropertyChanged();
107107
}
108108
}

src/Files.App/Views/SettingsPages/Appearance.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
</local:SettingsBlockControl.Icon>
183183
<ToggleSwitch
184184
AutomationProperties.Name="{helpers:ResourceString Name=SettingsContextMenuOverflow}"
185-
IsOn="{x:Bind ViewModel.MoveOverflowMenuItemsToSubMenu, Mode=TwoWay}"
185+
IsOn="{x:Bind ViewModel.MoveShellExtensionsToSubMenu, Mode=TwoWay}"
186186
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
187187
</local:SettingsBlockControl>
188188
</StackPanel>

src/Files.Backend/Services/Settings/IAppearanceSettingsService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ namespace Files.Backend.Services.Settings
66
public interface IAppearanceSettingsService : IBaseSettingsService, INotifyPropertyChanged
77
{
88
/// <summary>
9-
/// Gets or sets a value indicating whether or not to move overflow menu items into a sub menu.
9+
/// Gets or sets a value indicating whether or not to move shell extensions into a sub menu.
1010
/// </summary>
11-
bool MoveOverflowMenuItemsToSubMenu { get; set; }
11+
bool MoveShellExtensionsToSubMenu { get; set; }
1212

1313
#region Internal Settings
1414

0 commit comments

Comments
 (0)