Skip to content

Commit 25deb56

Browse files
authored
Feature: Update color icons (#11484)
1 parent 9e17b9e commit 25deb56

File tree

8 files changed

+597
-103
lines changed

8 files changed

+597
-103
lines changed

src/Files.App/BaseLayout.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,10 @@ private void AddNewFileTagsToMenu(CommandBarFlyout contextMenu)
705705
contextMenu.SecondaryCommands.Insert(index + 1, new AppBarButton()
706706
{
707707
Label = "SettingsEditFileTagsExpander/Title".GetLocalizedResource(),
708-
Icon = new FontIcon() { Glyph = "\uE1CB" },
708+
Content = new OpacityIcon()
709+
{
710+
Style = (Style)Application.Current.Resources["ColorIconTag"],
711+
},
709712
Flyout = fileTagsContextMenu
710713
});
711714
}

src/Files.App/Helpers/ContextFlyoutItemHelper.cs

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -676,10 +676,6 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
676676
new ContextMenuFlyoutItemViewModel()
677677
{
678678
Text = "OpenInNewPane".GetLocalizedResource(),
679-
OpacityIcon = new OpacityIconModel()
680-
{
681-
OpacityIconStyle = "ColorIconRightPane"
682-
},
683679
Command = commandsViewModel.OpenDirectoryInNewPaneCommand,
684680
ShowItem = itemsSelected && userSettingsService.PreferencesSettingsService.ShowOpenInNewPane && areAllItemsFolders,
685681
SingleItemOnly = true,
@@ -724,25 +720,23 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
724720
},
725721
new ContextMenuFlyoutItemViewModel
726722
{
727-
Text = "RotateRight".GetLocalizedResource(),
728-
ColoredIcon = new ColoredIconModel
723+
Text = "RotateLeft".GetLocalizedResource(),
724+
OpacityIcon = new OpacityIconModel()
729725
{
730-
BaseLayerGlyph = "\uF045",
731-
OverlayLayerGlyph = "\uF046",
726+
OpacityIconStyle = "ColorIconRotateLeft"
732727
},
733-
Command = commandsViewModel.RotateImageRightCommand,
728+
Command = commandsViewModel.RotateImageLeftCommand,
734729
ShowInSearchPage = true,
735730
ShowItem = selectedItemsPropertiesViewModel?.IsSelectedItemImage ?? false
736731
},
737732
new ContextMenuFlyoutItemViewModel
738733
{
739-
Text = "RotateLeft".GetLocalizedResource(),
740-
ColoredIcon = new ColoredIconModel
734+
Text = "RotateRight".GetLocalizedResource(),
735+
OpacityIcon = new OpacityIconModel()
741736
{
742-
BaseLayerGlyph = "\uF043",
743-
OverlayLayerGlyph = "\uF044",
737+
OpacityIconStyle = "ColorIconRotateRight"
744738
},
745-
Command = commandsViewModel.RotateImageLeftCommand,
739+
Command = commandsViewModel.RotateImageRightCommand,
746740
ShowInSearchPage = true,
747741
ShowItem = selectedItemsPropertiesViewModel?.IsSelectedItemImage ?? false
748742
},
@@ -815,10 +809,9 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
815809
new ContextMenuFlyoutItemViewModel()
816810
{
817811
Text = "CopyLocation".GetLocalizedResource(),
818-
ColoredIcon = new ColoredIconModel()
812+
OpacityIcon = new OpacityIconModel()
819813
{
820-
BaseLayerGlyph = "\uF04F",
821-
OverlayLayerGlyph = "\uF050"
814+
OpacityIconStyle = "ColorIconCopyLocation",
822815
},
823816
Command = commandsViewModel.CopyPathOfSelectedItemCommand,
824817
SingleItemOnly = true,
@@ -852,21 +845,19 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
852845
new ContextMenuFlyoutItemViewModel()
853846
{
854847
Text = "BaseLayoutItemContextFlyoutCreateFolderWithSelection/Text".GetLocalizedResource(),
855-
ColoredIcon = new ColoredIconModel()
848+
OpacityIcon = new OpacityIconModel()
856849
{
857-
BaseLayerGlyph = "\uF033",
858-
OverlayLayerGlyph = "\uF034"
850+
OpacityIconStyle = "ColorIconNewFolder",
859851
},
860852
Command = commandsViewModel.CreateFolderWithSelection,
861853
ShowItem = itemsSelected,
862854
},
863855
new ContextMenuFlyoutItemViewModel()
864856
{
865857
Text = "BaseLayoutItemContextFlyoutShortcut/Text".GetLocalizedResource(),
866-
ColoredIcon = new ColoredIconModel()
858+
OpacityIcon = new OpacityIconModel()
867859
{
868-
BaseLayerGlyph = "\uF04B",
869-
OverlayLayerGlyph = "\uF04C"
860+
OpacityIconStyle = "ColorIconShortcut",
870861
},
871862
Command = commandsViewModel.CreateShortcutCommand,
872863
ShowItem = itemsSelected && (!selectedItems.FirstOrDefault()?.IsShortcut ?? false),
@@ -950,7 +941,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
950941
new ContextMenuFlyoutItemViewModel()
951942
{
952943
Text = "BaseLayoutItemContextFlyoutPinToFavorites/Text".GetLocalizedResource(),
953-
Glyph = "\uE840",
944+
OpacityIcon = new OpacityIconModel()
945+
{
946+
OpacityIconStyle = "ColorIconPinToFavorites",
947+
},
954948
Command = commandsViewModel.SidebarPinItemCommand,
955949
ShowItem = userSettingsService.PreferencesSettingsService.ShowFavoritesSection && selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsArchive && !x.IsPinned),
956950
ShowInSearchPage = true,
@@ -959,7 +953,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
959953
new ContextMenuFlyoutItemViewModel()
960954
{
961955
Text = "UnpinFromFavorites".GetLocalizedResource(),
962-
Glyph = "\uE77A",
956+
OpacityIcon = new OpacityIconModel()
957+
{
958+
OpacityIconStyle = "ColorIconUnpinFromFavorites",
959+
},
963960
Command = commandsViewModel.SidebarUnpinItemCommand,
964961
ShowItem = userSettingsService.PreferencesSettingsService.ShowFavoritesSection && selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsArchive && x.IsPinned),
965962
ShowInSearchPage = true,
@@ -968,7 +965,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
968965
new ContextMenuFlyoutItemViewModel()
969966
{
970967
Text = "PinItemToStart/Text".GetLocalizedResource(),
971-
Glyph = "\uE840",
968+
OpacityIcon = new OpacityIconModel()
969+
{
970+
OpacityIconStyle = "ColorIconPinToFavorites",
971+
},
972972
Command = commandsViewModel.PinItemToStartCommand,
973973
ShowOnShift = true,
974974
ShowItem = selectedItems.All(x => !x.IsShortcut && (x.PrimaryItemAttribute == StorageItemTypes.Folder || x.IsExecutable) && !x.IsArchive && !x.IsItemPinnedToStart),
@@ -979,7 +979,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
979979
new ContextMenuFlyoutItemViewModel()
980980
{
981981
Text = "UnpinItemFromStart/Text".GetLocalizedResource(),
982-
Glyph = "\uE77A",
982+
OpacityIcon = new OpacityIconModel()
983+
{
984+
OpacityIconStyle = "ColorIconUnpinFromFavorites",
985+
},
983986
Command = commandsViewModel.UnpinItemFromStartCommand,
984987
ShowOnShift = true,
985988
ShowItem = selectedItems.All(x => !x.IsShortcut && (x.PrimaryItemAttribute == StorageItemTypes.Folder || x.IsExecutable) && !x.IsArchive && x.IsItemPinnedToStart),
@@ -991,22 +994,22 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
991994
{
992995
Text = "Archive".GetLocalizedResource(),
993996
ShowInSearchPage = true,
997+
OpacityIcon = new OpacityIconModel()
998+
{
999+
OpacityIconStyle = "ColorIconZip",
1000+
},
9941001
Items = new List<ContextMenuFlyoutItemViewModel>
9951002
{
9961003
new ContextMenuFlyoutItemViewModel
9971004
{
9981005
Text = "ExtractFiles".GetLocalizedResource(),
999-
Glyph = "\xF11A",
1000-
GlyphFontFamilyName = "CustomGlyph",
10011006
Command = commandsViewModel.DecompressArchiveCommand,
10021007
ShowItem = canDecompress,
10031008
ShowInSearchPage = true,
10041009
},
10051010
new ContextMenuFlyoutItemViewModel
10061011
{
10071012
Text = "ExtractHere".GetLocalizedResource(),
1008-
Glyph = "\xF11A",
1009-
GlyphFontFamilyName = "CustomGlyph",
10101013
Command = commandsViewModel.DecompressArchiveHereCommand,
10111014
ShowItem = canDecompress,
10121015
ShowInSearchPage = true,
@@ -1017,8 +1020,6 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
10171020
? string.Format("BaseLayoutItemContextFlyoutExtractToChildFolder".GetLocalizedResource(), "*")
10181021
: string.Format("BaseLayoutItemContextFlyoutExtractToChildFolder".GetLocalizedResource(),
10191022
Path.GetFileNameWithoutExtension(selectedItems.First().Name)),
1020-
Glyph = "\xF11A",
1021-
GlyphFontFamilyName = "CustomGlyph",
10221023
Command = commandsViewModel.DecompressArchiveToChildFolderCommand,
10231024
ShowInSearchPage = true,
10241025
ShowItem = canDecompress,
@@ -1031,23 +1032,20 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
10311032
new ContextMenuFlyoutItemViewModel
10321033
{
10331034
Text = "CreateArchive".GetLocalizedResource(),
1034-
Glyph = "\uE8DE",
10351035
Command = commandsViewModel.CompressIntoArchiveCommand,
10361036
ShowItem = canCompress,
10371037
ShowInSearchPage = true,
10381038
},
10391039
new ContextMenuFlyoutItemViewModel
10401040
{
10411041
Text = string.Format("CreateNamedArchive".GetLocalizedResource(), $"{newArchiveName}.zip"),
1042-
Glyph = "\uE8DE",
10431042
Command = commandsViewModel.CompressIntoZipCommand,
10441043
ShowItem = canCompress,
10451044
ShowInSearchPage = true,
10461045
},
10471046
new ContextMenuFlyoutItemViewModel
10481047
{
10491048
Text = string.Format("CreateNamedArchive".GetLocalizedResource(), $"{newArchiveName}.7z"),
1050-
Glyph = "\uE8DE",
10511049
Command = commandsViewModel.CompressIntoSevenZipCommand,
10521050
ShowItem = canCompress,
10531051
ShowInSearchPage = true,

0 commit comments

Comments
 (0)