Standardizing built-in extension icon handling (#40606)

Just standardizing built-in extensions to use a `internal sealed class
Icons` for all their non-dynamic icons.

Looks like a LOT of changes, but it's icons all the way down.
This commit is contained in:
Michael Jolley
2025-07-15 14:33:25 -05:00
committed by GitHub
parent cc16b61eb7
commit b552f2ac1e
93 changed files with 371 additions and 245 deletions

View File

@@ -20,7 +20,7 @@ internal sealed partial class CloseWindowCommand : InvokableCommand
public CloseWindowCommand(Window window)
{
Icon = new IconInfo("\uE894");
Icon = Icons.CloseWindow;
Name = $"{Resources.windowwalker_Close}";
_window = window;
}

View File

@@ -21,7 +21,7 @@ internal sealed partial class EndTaskCommand : InvokableCommand
public EndTaskCommand(Window window)
{
Icon = new IconInfo("\uF140");
Icon = Icons.EndTask;
Name = $"{Resources.windowwalker_Kill}";
_window = window;
}

View File

@@ -119,7 +119,7 @@ internal static class ResultHelper
return new WindowWalkerListItem(null)
{
Title = Resources.windowwalker_ExplorerInfoTitle,
Icon = new IconInfo("\uE946"), // Info
Icon = Icons.Info,
Subtitle = Resources.windowwalker_ExplorerInfoSubTitle,
Command = new ExplorerInfoResultCommand(),
};

View File

@@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.CommandPalette.Extensions.Toolkit;
namespace Microsoft.CmdPal.Ext.WindowWalker;
internal sealed class Icons
{
internal static IconInfo WindowWalkerIcon { get; } = IconHelpers.FromRelativePath("Assets\\WindowWalker.svg");
internal static IconInfo EndTask { get; } = new IconInfo("\uF140"); // StatusCircleBlock
internal static IconInfo CloseWindow { get; } = new IconInfo("\uE894"); // Clear
internal static IconInfo Info { get; } = new IconInfo("\uE946"); // Info
}

View File

@@ -19,7 +19,7 @@ internal sealed partial class WindowWalkerListPage : DynamicListPage, IDisposabl
public WindowWalkerListPage()
{
Icon = IconHelpers.FromRelativePath("Assets\\WindowWalker.svg");
Icon = Icons.WindowWalkerIcon;
Name = Resources.windowwalker_name;
Id = "com.microsoft.cmdpal.windowwalker";
PlaceholderText = Resources.windowwalker_PlaceholderText;

View File

@@ -20,7 +20,7 @@ public partial class WindowWalkerCommandsProvider : CommandProvider
{
Id = "WindowWalker";
DisplayName = Resources.windowwalker_name;
Icon = IconHelpers.FromRelativePath("Assets\\WindowWalker.svg");
Icon = Icons.WindowWalkerIcon;
Settings = SettingsManager.Instance.Settings;
_windowWalkerPageItem = new CommandItem(new WindowWalkerListPage())