Skip to content

Commit

Permalink
Feature: Update color icons (#11484)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 authored Feb 27, 2023
1 parent 9e17b9e commit 25deb56
Show file tree
Hide file tree
Showing 8 changed files with 597 additions and 103 deletions.
5 changes: 4 additions & 1 deletion src/Files.App/BaseLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,10 @@ private void AddNewFileTagsToMenu(CommandBarFlyout contextMenu)
contextMenu.SecondaryCommands.Insert(index + 1, new AppBarButton()
{
Label = "SettingsEditFileTagsExpander/Title".GetLocalizedResource(),
Icon = new FontIcon() { Glyph = "\uE1CB" },
Content = new OpacityIcon()
{
Style = (Style)Application.Current.Resources["ColorIconTag"],
},
Flyout = fileTagsContextMenu
});
}
Expand Down
70 changes: 34 additions & 36 deletions src/Files.App/Helpers/ContextFlyoutItemHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -676,10 +676,6 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModel()
{
Text = "OpenInNewPane".GetLocalizedResource(),
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconRightPane"
},
Command = commandsViewModel.OpenDirectoryInNewPaneCommand,
ShowItem = itemsSelected && userSettingsService.PreferencesSettingsService.ShowOpenInNewPane && areAllItemsFolders,
SingleItemOnly = true,
Expand Down Expand Up @@ -724,25 +720,23 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
},
new ContextMenuFlyoutItemViewModel
{
Text = "RotateRight".GetLocalizedResource(),
ColoredIcon = new ColoredIconModel
Text = "RotateLeft".GetLocalizedResource(),
OpacityIcon = new OpacityIconModel()
{
BaseLayerGlyph = "\uF045",
OverlayLayerGlyph = "\uF046",
OpacityIconStyle = "ColorIconRotateLeft"
},
Command = commandsViewModel.RotateImageRightCommand,
Command = commandsViewModel.RotateImageLeftCommand,
ShowInSearchPage = true,
ShowItem = selectedItemsPropertiesViewModel?.IsSelectedItemImage ?? false
},
new ContextMenuFlyoutItemViewModel
{
Text = "RotateLeft".GetLocalizedResource(),
ColoredIcon = new ColoredIconModel
Text = "RotateRight".GetLocalizedResource(),
OpacityIcon = new OpacityIconModel()
{
BaseLayerGlyph = "\uF043",
OverlayLayerGlyph = "\uF044",
OpacityIconStyle = "ColorIconRotateRight"
},
Command = commandsViewModel.RotateImageLeftCommand,
Command = commandsViewModel.RotateImageRightCommand,
ShowInSearchPage = true,
ShowItem = selectedItemsPropertiesViewModel?.IsSelectedItemImage ?? false
},
Expand Down Expand Up @@ -815,10 +809,9 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModel()
{
Text = "CopyLocation".GetLocalizedResource(),
ColoredIcon = new ColoredIconModel()
OpacityIcon = new OpacityIconModel()
{
BaseLayerGlyph = "\uF04F",
OverlayLayerGlyph = "\uF050"
OpacityIconStyle = "ColorIconCopyLocation",
},
Command = commandsViewModel.CopyPathOfSelectedItemCommand,
SingleItemOnly = true,
Expand Down Expand Up @@ -852,21 +845,19 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModel()
{
Text = "BaseLayoutItemContextFlyoutCreateFolderWithSelection/Text".GetLocalizedResource(),
ColoredIcon = new ColoredIconModel()
OpacityIcon = new OpacityIconModel()
{
BaseLayerGlyph = "\uF033",
OverlayLayerGlyph = "\uF034"
OpacityIconStyle = "ColorIconNewFolder",
},
Command = commandsViewModel.CreateFolderWithSelection,
ShowItem = itemsSelected,
},
new ContextMenuFlyoutItemViewModel()
{
Text = "BaseLayoutItemContextFlyoutShortcut/Text".GetLocalizedResource(),
ColoredIcon = new ColoredIconModel()
OpacityIcon = new OpacityIconModel()
{
BaseLayerGlyph = "\uF04B",
OverlayLayerGlyph = "\uF04C"
OpacityIconStyle = "ColorIconShortcut",
},
Command = commandsViewModel.CreateShortcutCommand,
ShowItem = itemsSelected && (!selectedItems.FirstOrDefault()?.IsShortcut ?? false),
Expand Down Expand Up @@ -950,7 +941,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModel()
{
Text = "BaseLayoutItemContextFlyoutPinToFavorites/Text".GetLocalizedResource(),
Glyph = "\uE840",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconPinToFavorites",
},
Command = commandsViewModel.SidebarPinItemCommand,
ShowItem = userSettingsService.PreferencesSettingsService.ShowFavoritesSection && selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsArchive && !x.IsPinned),
ShowInSearchPage = true,
Expand All @@ -959,7 +953,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModel()
{
Text = "UnpinFromFavorites".GetLocalizedResource(),
Glyph = "\uE77A",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconUnpinFromFavorites",
},
Command = commandsViewModel.SidebarUnpinItemCommand,
ShowItem = userSettingsService.PreferencesSettingsService.ShowFavoritesSection && selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsArchive && x.IsPinned),
ShowInSearchPage = true,
Expand All @@ -968,7 +965,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModel()
{
Text = "PinItemToStart/Text".GetLocalizedResource(),
Glyph = "\uE840",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconPinToFavorites",
},
Command = commandsViewModel.PinItemToStartCommand,
ShowOnShift = true,
ShowItem = selectedItems.All(x => !x.IsShortcut && (x.PrimaryItemAttribute == StorageItemTypes.Folder || x.IsExecutable) && !x.IsArchive && !x.IsItemPinnedToStart),
Expand All @@ -979,7 +979,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModel()
{
Text = "UnpinItemFromStart/Text".GetLocalizedResource(),
Glyph = "\uE77A",
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconUnpinFromFavorites",
},
Command = commandsViewModel.UnpinItemFromStartCommand,
ShowOnShift = true,
ShowItem = selectedItems.All(x => !x.IsShortcut && (x.PrimaryItemAttribute == StorageItemTypes.Folder || x.IsExecutable) && !x.IsArchive && x.IsItemPinnedToStart),
Expand All @@ -991,22 +994,22 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
{
Text = "Archive".GetLocalizedResource(),
ShowInSearchPage = true,
OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconZip",
},
Items = new List<ContextMenuFlyoutItemViewModel>
{
new ContextMenuFlyoutItemViewModel
{
Text = "ExtractFiles".GetLocalizedResource(),
Glyph = "\xF11A",
GlyphFontFamilyName = "CustomGlyph",
Command = commandsViewModel.DecompressArchiveCommand,
ShowItem = canDecompress,
ShowInSearchPage = true,
},
new ContextMenuFlyoutItemViewModel
{
Text = "ExtractHere".GetLocalizedResource(),
Glyph = "\xF11A",
GlyphFontFamilyName = "CustomGlyph",
Command = commandsViewModel.DecompressArchiveHereCommand,
ShowItem = canDecompress,
ShowInSearchPage = true,
Expand All @@ -1017,8 +1020,6 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
? string.Format("BaseLayoutItemContextFlyoutExtractToChildFolder".GetLocalizedResource(), "*")
: string.Format("BaseLayoutItemContextFlyoutExtractToChildFolder".GetLocalizedResource(),
Path.GetFileNameWithoutExtension(selectedItems.First().Name)),
Glyph = "\xF11A",
GlyphFontFamilyName = "CustomGlyph",
Command = commandsViewModel.DecompressArchiveToChildFolderCommand,
ShowInSearchPage = true,
ShowItem = canDecompress,
Expand All @@ -1031,23 +1032,20 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
new ContextMenuFlyoutItemViewModel
{
Text = "CreateArchive".GetLocalizedResource(),
Glyph = "\uE8DE",
Command = commandsViewModel.CompressIntoArchiveCommand,
ShowItem = canCompress,
ShowInSearchPage = true,
},
new ContextMenuFlyoutItemViewModel
{
Text = string.Format("CreateNamedArchive".GetLocalizedResource(), $"{newArchiveName}.zip"),
Glyph = "\uE8DE",
Command = commandsViewModel.CompressIntoZipCommand,
ShowItem = canCompress,
ShowInSearchPage = true,
},
new ContextMenuFlyoutItemViewModel
{
Text = string.Format("CreateNamedArchive".GetLocalizedResource(), $"{newArchiveName}.7z"),
Glyph = "\uE8DE",
Command = commandsViewModel.CompressIntoSevenZipCommand,
ShowItem = canCompress,
ShowInSearchPage = true,
Expand Down
Loading

0 comments on commit 25deb56

Please sign in to comment.