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

@@ -1,18 +0,0 @@
// 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.Calc.Helper;
public static class CalculatorIcons
{
public static IconInfo ResultIcon => new("\uE94E");
public static IconInfo SaveIcon => new("\uE74E");
public static IconInfo ErrorIcon => new("\uE783");
public static IconInfo ProviderIcon => IconHelpers.FromRelativePath("Assets\\Calculator.svg");
}

View File

@@ -47,7 +47,7 @@ internal static class ErrorHandler
{
Title = Properties.Resources.calculator_calculation_failed_title,
Subtitle = errorMessage,
Icon = CalculatorIcons.ErrorIcon,
Icon = Icons.ErrorIcon,
};
}
}

View File

@@ -33,7 +33,7 @@ public static class ResultHelper
return new ListItem(saveCommand)
{
// Using CurrentCulture since this is user facing
Icon = CalculatorIcons.ResultIcon,
Icon = Icons.ResultIcon,
Title = result,
Subtitle = query,
TextToSuggest = result,

View File

@@ -18,7 +18,7 @@ public sealed partial class SaveCommand : InvokableCommand
public SaveCommand(string result)
{
Name = Resources.calculator_save_command_name;
Icon = CalculatorIcons.SaveIcon;
Icon = Icons.SaveIcon;
_result = result;
}