Skip to content

Feature: Improve tags context menu #11468

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

Merged
merged 12 commits into from
Feb 26, 2023
5 changes: 2 additions & 3 deletions src/Files.App/Helpers/ContextFlyoutItemHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,9 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModel()
{
Text = "SortBy".GetLocalizedResource(),
ColoredIcon = new ColoredIconModel()
OpacityIcon = new OpacityIconModel()
{
BaseLayerGlyph = "\uF029",
OverlayLayerGlyph = "\uF02A",
OpacityIconStyle = "ColorIconSort",
},
ShowInRecycleBin = true,
ShowInSearchPage = true,
Expand Down
5 changes: 2 additions & 3 deletions src/Files.App/Helpers/ShellContextMenuHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,9 @@ public static async Task LoadShellMenuItems(
var openWithItem = shellMenuItems.Where(x => (x.Tag as Win32ContextMenuItem)?.CommandString == "openas").ToList().FirstOrDefault();
if (openWithItem is not null)
{
openWithItem.ColoredIcon = new ColoredIconModel()
openWithItem.OpacityIcon = new OpacityIconModel()
{
BaseLayerGlyph = "\uF049",
OverlayLayerGlyph = "\uF04A",
OpacityIconStyle = "ColorIconOpenWith",
};
var (_, openWithItems) = ItemModelListToContextFlyoutHelper.GetAppBarItemsFromModel(new List<ContextMenuFlyoutItemViewModel>() { openWithItem });
var placeholder = itemContextMenuFlyout.SecondaryCommands.Where(x => Equals((x as AppBarButton)?.Tag, "OpenWithPlaceholder")).FirstOrDefault() as AppBarButton;
Expand Down
22 changes: 14 additions & 8 deletions src/Files.App/UserControls/SidebarControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,26 +213,29 @@ private List<ContextMenuFlyoutItemViewModel> GetLocationItemMenuItems(INavigatio
new ContextMenuFlyoutItemViewModel()
{
Text = "OpenInNewTab".GetLocalizedResource(),
Glyph = "\uF113",
GlyphFontFamilyName = "CustomGlyph",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconOpenInNewTab",
},
Command = OpenInNewTabCommand,
ShowItem = options.IsLocationItem && userSettingsService.PreferencesSettingsService.ShowOpenInNewTab
},
new ContextMenuFlyoutItemViewModel()
{
Text = "OpenInNewWindow".GetLocalizedResource(),
Glyph = "\uE737",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconOpenInNewWindow",
},
Command = OpenInNewWindowCommand,
ShowItem = options.IsLocationItem && userSettingsService.PreferencesSettingsService.ShowOpenInNewTab
},
new ContextMenuFlyoutItemViewModel()
{
Text = "OpenInNewPane".GetLocalizedResource(),
ColoredIcon = new ColoredIconModel()
OpacityIcon = new OpacityIconModel()
{
BaseBackdropGlyph = "\uF056",
BaseLayerGlyph = "\uF03B",
OverlayLayerGlyph = "\uF03C",
OpacityIconStyle = "ColorIconRightPane",
},
Command = OpenInNewPaneCommand,
ShowItem = options.IsLocationItem && userSettingsService.PreferencesSettingsService.ShowOpenInNewPane
Expand Down Expand Up @@ -276,7 +279,10 @@ private List<ContextMenuFlyoutItemViewModel> GetLocationItemMenuItems(INavigatio
new ContextMenuFlyoutItemViewModel()
{
Text = "Properties".GetLocalizedResource(),
Glyph = "\uE946",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconProperties",
},
Command = OpenPropertiesCommand,
CommandParameter = menu,
ShowItem = options.ShowProperties
Expand Down
25 changes: 16 additions & 9 deletions src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ public DrivesWidget()
MapNetworkDriveCommand = new AsyncRelayCommand(DoNetworkMapDrive);
DisconnectNetworkDriveCommand = new RelayCommand<DriveCardItem>(DisconnectNetworkDrive);
}

public override List<ContextMenuFlyoutItemViewModel> GetItemMenuItems(WidgetCardItem item, bool isPinned)
public override List<ContextMenuFlyoutItemViewModel> GetItemMenuItems(WidgetCardItem item, bool isPinned, bool isFolder = false)
{
var drive = ItemsAdded.Where(x => string.Equals(PathNormalization.NormalizePath(x.Path), PathNormalization.NormalizePath(item.Path), StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
var options = drive?.Item.MenuOptions;
Expand All @@ -151,7 +151,10 @@ public override List<ContextMenuFlyoutItemViewModel> GetItemMenuItems(WidgetCard
new ContextMenuFlyoutItemViewModel()
{
Text = "OpenInNewTab".GetLocalizedResource(),
Glyph = "\uF113",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconOpenInNewTab",
},
GlyphFontFamilyName = "CustomGlyph",
Command = OpenInNewTabCommand,
CommandParameter = item,
Expand All @@ -160,19 +163,20 @@ public override List<ContextMenuFlyoutItemViewModel> GetItemMenuItems(WidgetCard
new ContextMenuFlyoutItemViewModel()
{
Text = "OpenInNewWindow".GetLocalizedResource(),
Glyph = "\uE737",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconOpenInNewWindow",
},
Command = OpenInNewWindowCommand,
CommandParameter = item,
ShowItem = userSettingsService.PreferencesSettingsService.ShowOpenInNewWindow
},
new ContextMenuFlyoutItemViewModel()
{
Text = "OpenInNewPane".GetLocalizedResource(),
ColoredIcon = new ColoredIconModel()
OpacityIcon = new OpacityIconModel()
{
BaseBackdropGlyph = "\uF056",
BaseLayerGlyph = "\uF03B",
OverlayLayerGlyph = "\uF03C",
OpacityIconStyle = "ColorIconRightPane",
},
Command = OpenInNewPaneCommand,
CommandParameter = item,
Expand Down Expand Up @@ -213,7 +217,10 @@ public override List<ContextMenuFlyoutItemViewModel> GetItemMenuItems(WidgetCard
new ContextMenuFlyoutItemViewModel()
{
Text = "Properties".GetLocalizedResource(),
Glyph = "\uE946",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconProperties",
},
Command = OpenPropertiesCommand,
CommandParameter = item
},
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/UserControls/Widgets/FileTagsWidget.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
xmlns:local="using:Files.App.UserControls.Widgets"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vc="using:Files.App.ValueConverters"
xmlns:vm="using:Files.Backend.ViewModels.Widgets.FileTagsWidget"
xmlns:vm="using:Files.App.ViewModels.Widgets"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">
Expand Down
Loading