mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
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:
@@ -25,7 +25,7 @@ public partial class AllAppsCommandProvider : CommandProvider
|
||||
{
|
||||
Id = WellKnownId;
|
||||
DisplayName = Resources.installed_apps;
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\AllApps.svg");
|
||||
Icon = Icons.AllAppsIcon;
|
||||
Settings = AllAppsSettings.Instance.Settings;
|
||||
|
||||
_listItem = new(Page)
|
||||
|
||||
@@ -12,7 +12,6 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Commands;
|
||||
using Microsoft.CmdPal.Ext.Apps.Helpers;
|
||||
using Microsoft.CmdPal.Ext.Apps.Programs;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CmdPal.Ext.Apps.State;
|
||||
|
||||
@@ -6,7 +6,6 @@ using System;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Helpers;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Helpers;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
@@ -19,7 +18,7 @@ internal sealed partial class OpenInConsoleCommand : InvokableCommand
|
||||
public OpenInConsoleCommand(string target)
|
||||
{
|
||||
Name = Resources.open_path_in_console;
|
||||
Icon = Icons.OpenConsoleIcon;
|
||||
Icon = Icons.OpenPathIcon;
|
||||
|
||||
_target = target;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CmdPal.Ext.Apps.Helpers;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.CmdPal.Ext.Apps.Helpers;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CmdPal.Ext.Apps.State;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CmdPal.Ext.Apps.Helpers;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CmdPal.Ext.Apps.Utils;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
@@ -21,7 +20,7 @@ internal sealed partial class RunAsAdminCommand : InvokableCommand
|
||||
public RunAsAdminCommand(string target, string parentDir, bool packaged)
|
||||
{
|
||||
Name = Resources.run_as_administrator;
|
||||
Icon = Icons.RunAsIcon;
|
||||
Icon = Icons.RunAsAdminIcon;
|
||||
|
||||
_target = target;
|
||||
_parentDir = parentDir;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CmdPal.Ext.Apps.Helpers;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CmdPal.Ext.Apps.Utils;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// 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.CmdPal.Ext.Apps.Helpers;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CmdPal.Ext.Apps.State;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
@@ -1,26 +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.Apps.Helpers;
|
||||
|
||||
public static partial class Icons
|
||||
{
|
||||
public static IconInfo UnpinIcon { get; } = new("\uE77A");
|
||||
|
||||
public static IconInfo PinIcon { get; } = new("\uE840");
|
||||
|
||||
public static IconInfo RunAsIcon { get; } = new("\uE7EF");
|
||||
|
||||
public static IconInfo RunAsUserIcon { get; } = new("\uE7EE");
|
||||
|
||||
public static IconInfo CopyIcon { get; } = new("\ue8c8");
|
||||
|
||||
public static IconInfo OpenConsoleIcon { get; } = new("\ue838");
|
||||
|
||||
public static IconInfo OpenPathIcon { get; } = new("\ue838");
|
||||
|
||||
public static IconInfo AllAppsIcon { get; } = IconHelpers.FromRelativePath("Assets\\AllApps.svg");
|
||||
}
|
||||
24
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Icons.cs
Normal file
24
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Icons.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
// 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.Apps;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo AllAppsIcon => IconHelpers.FromRelativePath("Assets\\AllApps.svg");
|
||||
|
||||
internal static IconInfo RunAsUserIcon => new("\uE7EE"); // OtherUser icon
|
||||
|
||||
internal static IconInfo RunAsAdminIcon => new("\uE7EF"); // Admin icon
|
||||
|
||||
internal static IconInfo OpenPathIcon => new("\ue838"); // Folder Open icon
|
||||
|
||||
internal static IconInfo CopyIcon => new("\ue8c8"); // Copy icon
|
||||
|
||||
public static IconInfo UnpinIcon { get; } = new("\uE77A"); // Unpin icon
|
||||
|
||||
public static IconInfo PinIcon { get; } = new("\uE840"); // Pin icon
|
||||
}
|
||||
@@ -106,7 +106,6 @@ public class UWPApplication : IProgram
|
||||
new OpenPathCommand(Location)
|
||||
{
|
||||
Name = Resources.open_containing_folder,
|
||||
Icon = new("\ue838"),
|
||||
})
|
||||
{
|
||||
RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.E),
|
||||
|
||||
Reference in New Issue
Block a user