Skip to content

Code Quality: Added workaround for open with icon to display correctly #14962

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 2 commits into from
Mar 18, 2024
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
5 changes: 2 additions & 3 deletions src/Files.App/Actions/FileSystem/OpenItemAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ public string Label
public string Description
=> "OpenItemWithApplicationPickerDescription".GetLocalizedResource();

// TODO add back icon when https://github.com/microsoft/microsoft-ui-xaml/issues/9409 is resolved
//public RichGlyph Glyph
// => new(opacityStyle: "ColorIconOpenWith");
public RichGlyph Glyph
=> new(opacityStyle: "ColorIconOpenWith");

public bool IsExecutable =>
context.HasSelection &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
}.Build(),
new ContextMenuFlyoutItemViewModel()
{
Text = "OpenWith".GetLocalizedResource(),
// TODO add back icon when https://github.com/microsoft/microsoft-ui-xaml/issues/9409 is resolved
// TODO add back text and icon when https://github.com/microsoft/microsoft-ui-xaml/issues/9409 is resolved
//Text = "OpenWith".GetLocalizedResource(),
//OpacityIcon = new OpacityIconModel()
//{
// OpacityIconStyle = "ColorIconOpenWith"
Expand Down
9 changes: 4 additions & 5 deletions src/Files.App/Data/Factories/ShellContextFlyoutHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,10 @@ x.Tag is Win32ContextMenuItem menuItem &&
{
await openWithItem.LoadSubMenuAction();

// TODO add back icon when https://github.com/microsoft/microsoft-ui-xaml/issues/9409 is resolved
//openWithItem.OpacityIcon = new OpacityIconModel()
//{
// OpacityIconStyle = "ColorIconOpenWith",
//};
openWithItem.OpacityIcon = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconOpenWith",
};
var (_, openWithItems) = ContextFlyoutModelToElementHelper.GetAppBarItemsFromModel(new List<ContextMenuFlyoutItemViewModel>() { openWithItem });
var placeholder = itemContextMenuFlyout.SecondaryCommands.Where(x => Equals((x as AppBarButton)?.Tag, "OpenWithPlaceholder")).FirstOrDefault() as AppBarButton;
if (placeholder is not null)
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Files.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<PackageReference Include="SevenZipSharp" Version="1.0.2" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.8" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240311000" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.1.1" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.2.0" />
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302" PrivateAssets="all" />
<PackageReference Include="CommunityToolkit.WinUI.Notifications" Version="7.1.2" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Behaviors" Version="7.1.2" />
Expand Down
7 changes: 7 additions & 0 deletions src/Files.App/Views/Layouts/BaseLayoutPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,13 @@ private async Task AddShellMenuItemsAsync(List<ContextMenuFlyoutItemViewModel> s
openWithOverflow.Flyout = flyout;
openWith.Visibility = Visibility.Collapsed;
openWithOverflow.Visibility = Visibility.Visible;

// TODO delete this when https://github.com/microsoft/microsoft-ui-xaml/issues/9409 is resolved
openWithOverflow.Content = new OpacityIconModel()
{
OpacityIconStyle = "ColorIconOpenWith"
}.ToOpacityIcon();
openWithOverflow.Label = "OpenWith".GetLocalizedResource();
}
}

Expand Down