mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +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:
@@ -29,7 +29,7 @@ internal sealed partial class LaunchProfileAsAdminCommand : InvokableCommand
|
||||
this._openQuake = openQuake;
|
||||
|
||||
this.Name = Resources.launch_profile_as_admin;
|
||||
this.Icon = new IconInfo("\xE7EF"); // Admin icon
|
||||
this.Icon = Icons.AdminIcon;
|
||||
}
|
||||
|
||||
private void LaunchElevated(string id, string profile)
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// 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.WindowsTerminal;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo TerminalIcon { get; } = IconHelpers.FromRelativePath("Assets\\WindowsTerminal.svg");
|
||||
|
||||
internal static IconInfo AdminIcon { get; } = new IconInfo("\xE7EF"); // Admin icon
|
||||
}
|
||||
@@ -24,7 +24,7 @@ internal sealed partial class ProfilesListPage : ListPage
|
||||
|
||||
public ProfilesListPage(SettingsManager terminalSettings)
|
||||
{
|
||||
Icon = WindowsTerminalCommandsProvider.TerminalIcon;
|
||||
Icon = Icons.TerminalIcon;
|
||||
Name = Resources.profiles_list_page_name;
|
||||
_terminalSettings = terminalSettings;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public partial class TerminalTopLevelCommandItem : CommandItem
|
||||
public TerminalTopLevelCommandItem(SettingsManager settingsManager)
|
||||
: base(new ProfilesListPage(settingsManager))
|
||||
{
|
||||
Icon = WindowsTerminalCommandsProvider.TerminalIcon;
|
||||
Icon = Icons.TerminalIcon;
|
||||
Title = Resources.list_item_title;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,11 @@ public partial class WindowsTerminalCommandsProvider : CommandProvider
|
||||
private readonly TerminalTopLevelCommandItem _terminalCommand;
|
||||
private readonly SettingsManager _settingsManager = new();
|
||||
|
||||
public static IconInfo TerminalIcon { get; } = IconHelpers.FromRelativePath("Assets\\WindowsTerminal.svg");
|
||||
|
||||
public WindowsTerminalCommandsProvider()
|
||||
{
|
||||
Id = "WindowsTerminalProfiles";
|
||||
DisplayName = Resources.extension_name;
|
||||
Icon = TerminalIcon;
|
||||
Icon = Icons.TerminalIcon;
|
||||
Settings = _settingsManager.Settings;
|
||||
|
||||
_terminalCommand = new TerminalTopLevelCommandItem(_settingsManager)
|
||||
|
||||
Reference in New Issue
Block a user