mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01: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),
|
||||
|
||||
@@ -25,7 +25,7 @@ internal sealed partial class AddBookmarkPage : ContentPage
|
||||
{
|
||||
var name = bookmark?.Name ?? string.Empty;
|
||||
var url = bookmark?.Bookmark ?? string.Empty;
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\Bookmark.svg");
|
||||
Icon = Icons.BookmarkIcon;
|
||||
var isAdd = string.IsNullOrEmpty(name) && string.IsNullOrEmpty(url);
|
||||
Title = isAdd ? Resources.bookmarks_add_title : Resources.bookmarks_edit_name;
|
||||
Name = isAdd ? Resources.bookmarks_add_name : Resources.bookmarks_edit_name;
|
||||
|
||||
@@ -23,15 +23,11 @@ public partial class BookmarksCommandProvider : CommandProvider
|
||||
|
||||
private Bookmarks? _bookmarks;
|
||||
|
||||
public static IconInfo DeleteIcon { get; private set; } = new("\uE74D"); // Delete
|
||||
|
||||
public static IconInfo EditIcon { get; private set; } = new("\uE70F"); // Edit
|
||||
|
||||
public BookmarksCommandProvider()
|
||||
{
|
||||
Id = "Bookmarks";
|
||||
DisplayName = Resources.bookmarks_display_name;
|
||||
Icon = new IconInfo("\uE718"); // Pin
|
||||
Icon = Icons.PinIcon;
|
||||
|
||||
_addNewCommand.AddedCommand += AddNewCommand_AddedCommand;
|
||||
}
|
||||
@@ -132,7 +128,7 @@ public partial class BookmarksCommandProvider : CommandProvider
|
||||
listItem.Subtitle = urlCommand.Url;
|
||||
}
|
||||
|
||||
var edit = new AddBookmarkPage(bookmark) { Icon = EditIcon };
|
||||
var edit = new AddBookmarkPage(bookmark) { Icon = Icons.EditIcon };
|
||||
edit.AddedCommand += Edit_AddedCommand;
|
||||
contextMenu.Add(new CommandContextItem(edit));
|
||||
|
||||
@@ -153,7 +149,7 @@ public partial class BookmarksCommandProvider : CommandProvider
|
||||
result: CommandResult.KeepOpen())
|
||||
{
|
||||
IsCritical = true,
|
||||
Icon = DeleteIcon,
|
||||
Icon = Icons.DeleteIcon,
|
||||
};
|
||||
contextMenu.Add(delete);
|
||||
|
||||
|
||||
@@ -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.Bookmarks;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo BookmarkIcon => IconHelpers.FromRelativePath("Assets\\Bookmark.svg");
|
||||
|
||||
internal static IconInfo DeleteIcon { get; private set; } = new("\uE74D"); // Delete
|
||||
|
||||
internal static IconInfo EditIcon { get; private set; } = new("\uE70F"); // Edit
|
||||
|
||||
internal static IconInfo PinIcon { get; private set; } = new IconInfo("\uE718"); // Pin
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public partial class CalculatorCommandProvider : CommandProvider
|
||||
{
|
||||
Id = "Calculator";
|
||||
DisplayName = Resources.calculator_display_name;
|
||||
Icon = CalculatorIcons.ProviderIcon;
|
||||
Icon = Icons.CalculatorIcon;
|
||||
Settings = settings.Settings;
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
@@ -47,7 +47,7 @@ internal static class ErrorHandler
|
||||
{
|
||||
Title = Properties.Resources.calculator_calculation_failed_title,
|
||||
Subtitle = errorMessage,
|
||||
Icon = CalculatorIcons.ErrorIcon,
|
||||
Icon = Icons.ErrorIcon,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
18
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Calc/Icons.cs
Normal file
18
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Calc/Icons.cs
Normal 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.Calc;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo CalculatorIcon => IconHelpers.FromRelativePath("Assets\\Calculator.svg");
|
||||
|
||||
internal static IconInfo ResultIcon => new("\uE94E"); // CalculatorEqualTo icon
|
||||
|
||||
internal static IconInfo SaveIcon => new("\uE74E"); // Save icon
|
||||
|
||||
internal static IconInfo ErrorIcon => new("\uE783"); // Error icon
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public sealed partial class CalculatorListPage : DynamicListPage
|
||||
public CalculatorListPage(SettingsManager settings)
|
||||
{
|
||||
_settingsManager = settings;
|
||||
Icon = CalculatorIcons.ProviderIcon;
|
||||
Icon = Icons.CalculatorIcon;
|
||||
Name = Resources.calculator_title;
|
||||
PlaceholderText = Resources.calculator_placeholder_text;
|
||||
Id = "com.microsoft.cmdpal.calculator";
|
||||
@@ -43,11 +43,11 @@ public sealed partial class CalculatorListPage : DynamicListPage
|
||||
_emptyItem = new ListItem(new NoOpCommand())
|
||||
{
|
||||
Title = Resources.calculator_placeholder_text,
|
||||
Icon = CalculatorIcons.ResultIcon,
|
||||
Icon = Icons.ResultIcon,
|
||||
};
|
||||
EmptyContent = new CommandItem(new NoOpCommand())
|
||||
{
|
||||
Icon = CalculatorIcons.ProviderIcon,
|
||||
Icon = Icons.CalculatorIcon,
|
||||
Title = Resources.calculator_placeholder_text,
|
||||
};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public sealed partial class FallbackCalculatorItem : FallbackCommandItem
|
||||
_copyCommand.Name = string.Empty;
|
||||
Title = string.Empty;
|
||||
Subtitle = Resources.calculator_placeholder_text;
|
||||
Icon = CalculatorIcons.ProviderIcon;
|
||||
Icon = Icons.CalculatorIcon;
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ public partial class ClipboardHistoryCommandsProvider : CommandProvider
|
||||
{
|
||||
Title = Properties.Resources.list_item_title,
|
||||
Subtitle = Properties.Resources.list_item_subtitle,
|
||||
Icon = Icons.ClipboardList,
|
||||
Icon = Icons.ClipboardListIcon,
|
||||
};
|
||||
|
||||
DisplayName = Properties.Resources.provider_display_name;
|
||||
Icon = Icons.ClipboardList;
|
||||
Icon = Icons.ClipboardListIcon;
|
||||
Id = "Windows.ClipboardHistory";
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ internal sealed partial class CopyCommand : InvokableCommand
|
||||
Name = Properties.Resources.copy_command_name;
|
||||
if (clipboardFormat == ClipboardFormat.Text)
|
||||
{
|
||||
Icon = Icons.Copy;
|
||||
Icon = Icons.CopyIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
Icon = Icons.Picture;
|
||||
Icon = Icons.PictureIcon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ internal sealed partial class PasteCommand : InvokableCommand
|
||||
_clipboardItem = clipboardItem;
|
||||
_clipboardFormat = clipboardFormat;
|
||||
Name = Properties.Resources.paste_command_name;
|
||||
Icon = Icons.Paste;
|
||||
Icon = Icons.PasteIcon;
|
||||
}
|
||||
|
||||
private void HideWindow()
|
||||
|
||||
@@ -8,11 +8,11 @@ namespace Microsoft.CmdPal.Ext.ClipboardHistory;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo Copy { get; } = new("\xE8C8");
|
||||
internal static IconInfo CopyIcon { get; } = new("\xE8C8");
|
||||
|
||||
internal static IconInfo Picture { get; } = new("\xE8B9");
|
||||
internal static IconInfo PictureIcon { get; } = new("\xE8B9");
|
||||
|
||||
internal static IconInfo Paste { get; } = new("\uE77F");
|
||||
internal static IconInfo PasteIcon { get; } = new("\uE77F");
|
||||
|
||||
internal static IconInfo ClipboardList { get; } = new("\uF0E3");
|
||||
internal static IconInfo ClipboardListIcon { get; } = new("\uF0E3");
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ internal sealed partial class ClipboardHistoryListPage : ListPage
|
||||
{
|
||||
clipboardHistory = [];
|
||||
_defaultIconPath = string.Empty;
|
||||
Icon = Icons.ClipboardList;
|
||||
Icon = Icons.ClipboardListIcon;
|
||||
Name = Properties.Resources.clipboard_history_page_name;
|
||||
Id = "com.microsoft.cmdpal.clipboardHistory";
|
||||
ShowDetails = true;
|
||||
|
||||
@@ -19,7 +19,7 @@ internal sealed partial class OpenFileCommand : InvokableCommand
|
||||
{
|
||||
this._item = item;
|
||||
this.Name = Resources.Indexer_Command_OpenFile;
|
||||
this.Icon = Icons.OpenFile;
|
||||
this.Icon = Icons.OpenFileIcon;
|
||||
}
|
||||
|
||||
public override CommandResult Invoke()
|
||||
|
||||
@@ -28,7 +28,7 @@ internal sealed partial class FallbackOpenFileItem : FallbackCommandItem, System
|
||||
{
|
||||
Title = string.Empty;
|
||||
Subtitle = string.Empty;
|
||||
Icon = Icons.FileExplorer;
|
||||
Icon = Icons.FileExplorerIcon;
|
||||
}
|
||||
|
||||
public override void UpdateQuery(string query)
|
||||
@@ -106,7 +106,7 @@ internal sealed partial class FallbackOpenFileItem : FallbackCommandItem, System
|
||||
// us to the file search page, prepopulated with this search.
|
||||
var indexerPage = new IndexerPage(query, _searchEngine, _queryCookie, results);
|
||||
Title = string.Format(CultureInfo.CurrentCulture, fallbackItemSearchPageTitleCompositeFormat, query);
|
||||
Icon = Icons.FileExplorer;
|
||||
Icon = Icons.FileExplorerIcon;
|
||||
Subtitle = Resources.Indexer_Subtitle;
|
||||
Command = indexerPage;
|
||||
|
||||
|
||||
22
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Indexer/Icons.cs
Normal file
22
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Indexer/Icons.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
// 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.Indexer;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo FileExplorerSegoeIcon { get; } = new("\uEC50");
|
||||
|
||||
internal static IconInfo FileExplorerIcon { get; } = IconHelpers.FromRelativePath("Assets\\FileExplorer.png");
|
||||
|
||||
internal static IconInfo ActionsIcon { get; } = IconHelpers.FromRelativePath("Assets\\Actions.png");
|
||||
|
||||
internal static IconInfo OpenFileIcon { get; } = new("\uE8E5"); // OpenFile
|
||||
|
||||
internal static IconInfo DocumentIcon { get; } = new("\uE8A5"); // Document
|
||||
|
||||
internal static IconInfo FolderOpenIcon { get; } = new("\uE838"); // FolderOpen
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public partial class IndexerCommandsProvider : CommandProvider
|
||||
{
|
||||
Id = "Files";
|
||||
DisplayName = Resources.IndexerCommandsProvider_DisplayName;
|
||||
Icon = Icons.FileExplorer;
|
||||
Icon = Icons.FileExplorerIcon;
|
||||
|
||||
if (IndexerListItem.IsActionsFeatureEnabled && ApiInformation.IsApiContractPresent("Windows.AI.Actions.ActionsContract", 4))
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ internal sealed partial class ActionsListContextItem : CommandContextItem, IDisp
|
||||
: base(new NoOpCommand())
|
||||
{
|
||||
Title = Resources.Indexer_Command_Actions;
|
||||
Icon = Icons.Actions;
|
||||
Icon = Icons.ActionsIcon;
|
||||
RequestedShortcut = KeyChordHelpers.FromModifiers(alt: true, vkey: VirtualKey.A);
|
||||
this.fullPath = fullPath;
|
||||
UpdateMoreCommands();
|
||||
|
||||
@@ -28,7 +28,7 @@ public sealed partial class DirectoryExplorePage : DynamicListPage
|
||||
public DirectoryExplorePage(string path)
|
||||
{
|
||||
_path = path;
|
||||
Icon = Icons.FileExplorer;
|
||||
Icon = Icons.FileExplorerIcon;
|
||||
Name = Resources.Indexer_Command_Browse;
|
||||
Title = path;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public sealed partial class DirectoryPage : ListPage
|
||||
public DirectoryPage(string path)
|
||||
{
|
||||
_path = path;
|
||||
Icon = Icons.FileExplorer;
|
||||
Icon = Icons.FileExplorerIcon;
|
||||
Name = Resources.Indexer_Command_Browse;
|
||||
Title = path;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public sealed partial class DirectoryPage : ListPage
|
||||
EmptyContent = new CommandItem(
|
||||
title: Resources.Indexer_File_Is_File_Not_Folder, subtitle: $"{_path}")
|
||||
{
|
||||
Icon = Icons.Document,
|
||||
Icon = Icons.DocumentIcon,
|
||||
};
|
||||
return [];
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public sealed partial class DirectoryPage : ListPage
|
||||
EmptyContent = new CommandItem(
|
||||
title: Resources.Indexer_Folder_Is_Empty, subtitle: $"{_path}")
|
||||
{
|
||||
Icon = Icons.FolderOpen,
|
||||
Icon = Icons.FolderOpenIcon,
|
||||
Command = listItemForUs.Command,
|
||||
MoreCommands = listItemForUs.MoreCommands,
|
||||
};
|
||||
|
||||
@@ -1,22 +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.Indexer;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo FileExplorerSegoe { get; } = new("\uEC50");
|
||||
|
||||
internal static IconInfo FileExplorer { get; } = IconHelpers.FromRelativePath("Assets\\FileExplorer.png");
|
||||
|
||||
internal static IconInfo Actions { get; } = IconHelpers.FromRelativePath("Assets\\Actions.png");
|
||||
|
||||
internal static IconInfo OpenFile { get; } = new("\uE8E5"); // OpenFile
|
||||
|
||||
internal static IconInfo Document { get; } = new("\uE8A5"); // Document
|
||||
|
||||
internal static IconInfo FolderOpen { get; } = new("\uE838"); // FolderOpen
|
||||
}
|
||||
@@ -24,7 +24,7 @@ internal sealed partial class IndexerPage : DynamicListPage, IDisposable
|
||||
public IndexerPage()
|
||||
{
|
||||
Id = "com.microsoft.indexer.fileSearch";
|
||||
Icon = Icons.FileExplorer;
|
||||
Icon = Icons.FileExplorerIcon;
|
||||
Name = Resources.Indexer_Title;
|
||||
PlaceholderText = Resources.Indexer_PlaceholderText;
|
||||
_searchEngine = new();
|
||||
@@ -33,7 +33,7 @@ internal sealed partial class IndexerPage : DynamicListPage, IDisposable
|
||||
|
||||
public IndexerPage(string query, SearchEngine searchEngine, uint queryCookie, IList<IListItem> firstPageData)
|
||||
{
|
||||
Icon = Icons.FileExplorer;
|
||||
Icon = Icons.FileExplorerIcon;
|
||||
Name = Resources.Indexer_Title;
|
||||
_searchEngine = searchEngine;
|
||||
_queryCookie = queryCookie;
|
||||
|
||||
@@ -21,19 +21,19 @@ internal sealed partial class CopyRegistryInfoCommand : InvokableCommand
|
||||
if (typeToCopy == CopyType.Key)
|
||||
{
|
||||
Name = Resources.CopyKeyNamePath;
|
||||
Icon = new IconInfo("\xE8C8"); // Copy Icon
|
||||
Icon = Icons.CopyIcon;
|
||||
_stringToCopy = entry.GetRegistryKey();
|
||||
}
|
||||
else if (typeToCopy == CopyType.ValueData)
|
||||
{
|
||||
Name = Resources.CopyValueData;
|
||||
Icon = new IconInfo("\xF413"); // CopyTo Icon
|
||||
Icon = Icons.CopyToIcon;
|
||||
_stringToCopy = entry.GetValueData();
|
||||
}
|
||||
else if (typeToCopy == CopyType.ValueName)
|
||||
{
|
||||
Name = Resources.CopyValueName;
|
||||
Icon = new IconInfo("\xE8C8"); // Copy Icon
|
||||
Icon = Icons.CopyIcon;
|
||||
_stringToCopy = entry.GetValueNameWithKey();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ internal sealed partial class OpenKeyInEditorCommand : InvokableCommand
|
||||
internal OpenKeyInEditorCommand(RegistryEntry entry)
|
||||
{
|
||||
Name = Resources.OpenKeyInRegistryEditor;
|
||||
Icon = new IconInfo("\xE8A7"); // OpenInNewWindow icon
|
||||
Icon = Icons.OpenInNewWindowIcon;
|
||||
_entry = entry;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ internal static class ResultHelper
|
||||
|
||||
resultList.Add(new ListItem(new OpenKeyInEditorCommand(registryEntry))
|
||||
{
|
||||
Icon = RegistryListPage.RegistryIcon,
|
||||
Icon = Icons.RegistryIcon,
|
||||
Subtitle = GetTruncatedText(valueException.Message, MaxTextLength.MaximumSubTitleLengthWithThreeSymbols, TruncateSide.OnlyFromRight),
|
||||
Title = GetTruncatedText(key.Name, MaxTextLength.MaximumTitleLengthWithThreeSymbols),
|
||||
MoreCommands = ContextMenuHelper.GetContextMenu(registryEntry).ToArray(),
|
||||
@@ -130,7 +130,7 @@ internal static class ResultHelper
|
||||
|
||||
resultList.Add(new ListItem(new OpenKeyInEditorCommand(registryEntry))
|
||||
{
|
||||
Icon = RegistryListPage.RegistryIcon,
|
||||
Icon = Icons.RegistryIcon,
|
||||
Subtitle = GetTruncatedText(GetSubTileForRegistryValue(key, valueEntry), MaxTextLength.MaximumSubTitleLengthWithThreeSymbols, TruncateSide.OnlyFromRight),
|
||||
Title = GetTruncatedText(valueName, MaxTextLength.MaximumTitleLengthWithThreeSymbols),
|
||||
MoreCommands = ContextMenuHelper.GetContextMenu(registryEntry).ToArray(),
|
||||
@@ -145,7 +145,7 @@ internal static class ResultHelper
|
||||
|
||||
resultList.Add(new ListItem(new OpenKeyInEditorCommand(registryEntry))
|
||||
{
|
||||
Icon = RegistryListPage.RegistryIcon,
|
||||
Icon = Icons.RegistryIcon,
|
||||
Subtitle = GetTruncatedText(exception.Message, MaxTextLength.MaximumSubTitleLengthWithThreeSymbols, TruncateSide.OnlyFromRight),
|
||||
Title = GetTruncatedText(key.Name, MaxTextLength.MaximumTitleLengthWithThreeSymbols),
|
||||
});
|
||||
|
||||
@@ -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.Registry;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo RegistryIcon { get; } = IconHelpers.FromRelativePath("Assets\\Registry.svg");
|
||||
|
||||
internal static IconInfo OpenInNewWindowIcon { get; } = new IconInfo("\xE8A7"); // OpenInNewWindow icon
|
||||
|
||||
internal static IconInfo CopyIcon { get; } = new IconInfo("\xE8C8"); // Copy icon
|
||||
|
||||
internal static IconInfo CopyToIcon { get; } = new IconInfo("\xF413"); // CopyTo Icon
|
||||
}
|
||||
@@ -21,12 +21,12 @@ internal sealed partial class RegistryListPage : DynamicListPage
|
||||
|
||||
public RegistryListPage()
|
||||
{
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\Registry.svg");
|
||||
Icon = Icons.RegistryIcon;
|
||||
Name = Title = Resources.Registry_Page_Title;
|
||||
Id = "com.microsoft.cmdpal.registry";
|
||||
_emptyMessage = new CommandItem()
|
||||
{
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\Registry.svg"),
|
||||
Icon = Icons.RegistryIcon,
|
||||
Title = Resources.Registry_Key_Not_Found,
|
||||
Subtitle = SearchText,
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ public partial class RegistryCommandsProvider : CommandProvider
|
||||
{
|
||||
Id = "Windows.Registry";
|
||||
DisplayName = Resources.RegistryProvider_DisplayName;
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\Registry.svg");
|
||||
Icon = Icons.RegistryIcon;
|
||||
}
|
||||
|
||||
public override ICommandItem[] TopLevelCommands()
|
||||
|
||||
@@ -26,17 +26,17 @@ internal sealed partial class ExecuteItem : InvokableCommand
|
||||
if (type == RunAsType.Administrator)
|
||||
{
|
||||
Name = Properties.Resources.cmd_run_as_administrator;
|
||||
Icon = new IconInfo("\xE7EF"); // Admin Icon
|
||||
Icon = Icons.AdminIcon;
|
||||
}
|
||||
else if (type == RunAsType.OtherUser)
|
||||
{
|
||||
Name = Properties.Resources.cmd_run_as_user;
|
||||
Icon = new IconInfo("\xE7EE"); // User Icon
|
||||
Icon = Icons.UserIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
Name = Properties.Resources.generic_run_command;
|
||||
Icon = new IconInfo("\uE751"); // Return Key Icon
|
||||
Icon = Icons.ReturnIcon;
|
||||
}
|
||||
|
||||
Cmd = cmd;
|
||||
|
||||
@@ -24,7 +24,7 @@ internal sealed partial class FallbackExecuteItem : FallbackCommandItem
|
||||
Title = string.Empty;
|
||||
_executeItem.Name = string.Empty;
|
||||
Subtitle = Properties.Resources.generic_run_command;
|
||||
Icon = Icons.RunV2; // Defined in Icons.cs and contains the execute command icon.
|
||||
Icon = Icons.RunV2Icon; // Defined in Icons.cs and contains the execute command icon.
|
||||
}
|
||||
|
||||
public override void UpdateQuery(string query)
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ShellListPageHelpers
|
||||
|
||||
// Using CurrentCulture since this is user facing
|
||||
Subtitle = Properties.Resources.cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, CmdHasBeenExecutedTimes, m.Value),
|
||||
Icon = new IconInfo("\uE81C"),
|
||||
Icon = Icons.HistoryIcon,
|
||||
};
|
||||
return ret;
|
||||
}).Where(o => o != null).Take(4);
|
||||
@@ -108,7 +108,7 @@ public class ShellListPageHelpers
|
||||
|
||||
// Using CurrentCulture since this is user facing
|
||||
Subtitle = Properties.Resources.cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, CmdHasBeenExecutedTimes, m.Value),
|
||||
Icon = new IconInfo("\uE81C"),
|
||||
Icon = Icons.HistoryIcon,
|
||||
}).Take(5);
|
||||
|
||||
return history.ToList();
|
||||
|
||||
@@ -8,5 +8,13 @@ namespace Microsoft.CmdPal.Ext.Shell;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo RunV2 { get; } = IconHelpers.FromRelativePath("Assets\\Run.svg");
|
||||
internal static IconInfo RunV2Icon { get; } = IconHelpers.FromRelativePath("Assets\\Run.svg");
|
||||
|
||||
internal static IconInfo HistoryIcon { get; } = new IconInfo("\uE81C"); // History
|
||||
|
||||
internal static IconInfo AdminIcon { get; } = new IconInfo("\xE7EF"); // Admin Icon
|
||||
|
||||
internal static IconInfo UserIcon { get; } = new IconInfo("\xE7EE"); // User Icon
|
||||
|
||||
internal static IconInfo ReturnIcon { get; } = new IconInfo("\uE751"); // Return Key Icon
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ internal sealed partial class ShellListPage : DynamicListPage
|
||||
|
||||
public ShellListPage(SettingsManager settingsManager)
|
||||
{
|
||||
Icon = Icons.RunV2;
|
||||
Icon = Icons.RunV2Icon;
|
||||
Id = "com.microsoft.cmdpal.shell";
|
||||
Name = Resources.cmd_plugin_name;
|
||||
PlaceholderText = Resources.list_placeholder_text;
|
||||
|
||||
@@ -20,14 +20,14 @@ public partial class ShellCommandsProvider : CommandProvider
|
||||
{
|
||||
Id = "Run";
|
||||
DisplayName = Resources.cmd_plugin_name;
|
||||
Icon = Icons.RunV2;
|
||||
Icon = Icons.RunV2Icon;
|
||||
Settings = _settingsManager.Settings;
|
||||
|
||||
_fallbackItem = new FallbackExecuteItem(_settingsManager);
|
||||
|
||||
_shellPageItem = new CommandItem(new ShellListPage(_settingsManager))
|
||||
{
|
||||
Icon = Icons.RunV2,
|
||||
Icon = Icons.RunV2Icon,
|
||||
Title = Resources.shell_command_name,
|
||||
Subtitle = Resources.cmd_plugin_description,
|
||||
MoreCommands = [
|
||||
|
||||
@@ -1,28 +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.System.Helpers;
|
||||
|
||||
public static partial class Icons
|
||||
{
|
||||
public static IconInfo FirmwareSettingsIcon { get; } = new IconInfo("\uE950");
|
||||
|
||||
public static IconInfo LockIcon { get; } = new IconInfo("\uE72E");
|
||||
|
||||
public static IconInfo LogoffIcon { get; } = new IconInfo("\uF3B1");
|
||||
|
||||
public static IconInfo NetworkAdapterIcon { get; } = new IconInfo("\uEDA3");
|
||||
|
||||
public static IconInfo RecycleBinIcon { get; } = new IconInfo("\uE74D");
|
||||
|
||||
public static IconInfo RestartIcon { get; } = new IconInfo("\uE777");
|
||||
|
||||
public static IconInfo RestartShellIcon { get; } = new IconInfo("\uEC50");
|
||||
|
||||
public static IconInfo ShutdownIcon { get; } = new IconInfo("\uE7E8");
|
||||
|
||||
public static IconInfo SleepIcon { get; } = new IconInfo("\uE708");
|
||||
}
|
||||
28
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Icons.cs
Normal file
28
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Icons.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
// 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.System;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo FirmwareSettingsIcon { get; } = new IconInfo("\uE950");
|
||||
|
||||
internal static IconInfo LockIcon { get; } = new IconInfo("\uE72E");
|
||||
|
||||
internal static IconInfo LogoffIcon { get; } = new IconInfo("\uF3B1");
|
||||
|
||||
internal static IconInfo NetworkAdapterIcon { get; } = new IconInfo("\uEDA3");
|
||||
|
||||
internal static IconInfo RecycleBinIcon { get; } = new IconInfo("\uE74D");
|
||||
|
||||
internal static IconInfo RestartIcon { get; } = new IconInfo("\uE777");
|
||||
|
||||
internal static IconInfo RestartShellIcon { get; } = new IconInfo("\uEC50");
|
||||
|
||||
internal static IconInfo ShutdownIcon { get; } = new IconInfo("\uE7E8");
|
||||
|
||||
internal static IconInfo SleepIcon { get; } = new IconInfo("\uE708");
|
||||
}
|
||||
@@ -42,10 +42,10 @@ internal sealed class AvailableResult
|
||||
{
|
||||
return IconType switch
|
||||
{
|
||||
ResultIconType.Time => ResultHelper.TimeIcon,
|
||||
ResultIconType.Date => ResultHelper.CalendarIcon,
|
||||
ResultIconType.DateTime => ResultHelper.TimeDateIcon,
|
||||
ResultIconType.Error => ResultHelper.ErrorIcon,
|
||||
ResultIconType.Time => Icons.TimeIcon,
|
||||
ResultIconType.Date => Icons.CalendarIcon,
|
||||
ResultIconType.DateTime => Icons.TimeDateIcon,
|
||||
ResultIconType.Error => Icons.ErrorIcon,
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ internal static class AvailableResultsList
|
||||
dtObject = dateTimeNowUtc;
|
||||
}
|
||||
|
||||
// Get formated date
|
||||
// Get formatted date
|
||||
var value = TimeAndDateHelper.ConvertToCustomFormat(dtObject, unixTimestamp, unixTimestampMilliseconds, weekOfYear, eraShort, Regex.Replace(formatSyntax, "^UTC:", string.Empty), firstWeekRule, firstDayOfTheWeek);
|
||||
try
|
||||
{
|
||||
|
||||
@@ -26,14 +26,6 @@ internal static class ResultHelper
|
||||
: Resources.ResourceManager.GetString(stringId + "Now", CultureInfo.CurrentUICulture) ?? string.Empty;
|
||||
}
|
||||
|
||||
public static IconInfo TimeIcon { get; } = new IconInfo("\uE823");
|
||||
|
||||
public static IconInfo CalendarIcon { get; } = new IconInfo("\uE787");
|
||||
|
||||
public static IconInfo TimeDateIcon { get; } = new IconInfo("\uEC92");
|
||||
|
||||
public static IconInfo ErrorIcon { get; } = IconHelpers.FromRelativePaths("Microsoft.CmdPal.Ext.TimeDate\\Assets\\Warning.light.png", "Microsoft.CmdPal.Ext.TimeDate\\Assets\\Warning.dark.png");
|
||||
|
||||
/// <summary>
|
||||
/// Gets a result with an error message that input can't be parsed
|
||||
/// </summary>
|
||||
@@ -42,7 +34,7 @@ internal static class ResultHelper
|
||||
internal static ListItem CreateInvalidInputErrorResult() => new ListItem(new NoOpCommand())
|
||||
{
|
||||
Title = Resources.Microsoft_plugin_timedate_InvalidInput_ErrorMessageTitle,
|
||||
Icon = ErrorIcon,
|
||||
Icon = Icons.ErrorIcon,
|
||||
Details = new Details()
|
||||
{
|
||||
Title = Resources.Microsoft_plugin_timedate_InvalidInput_DetailsHeader,
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// 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.TimeDate;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo TimeDateExtIcon { get; } = IconHelpers.FromRelativePath("Assets\\TimeDate.svg");
|
||||
|
||||
internal static IconInfo TimeIcon { get; } = new IconInfo("\uE823");
|
||||
|
||||
internal static IconInfo CalendarIcon { get; } = new IconInfo("\uE787");
|
||||
|
||||
internal static IconInfo TimeDateIcon { get; } = new IconInfo("\uEC92");
|
||||
|
||||
internal static IconInfo ErrorIcon { get; } = IconHelpers.FromRelativePaths("Microsoft.CmdPal.Ext.TimeDate\\Assets\\Warning.light.png", "Microsoft.CmdPal.Ext.TimeDate\\Assets\\Warning.dark.png");
|
||||
}
|
||||
@@ -23,7 +23,7 @@ internal sealed partial class TimeDateExtensionPage : DynamicListPage
|
||||
|
||||
public TimeDateExtensionPage(SettingsManager settingsManager)
|
||||
{
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\TimeDate.svg");
|
||||
Icon = Icons.TimeDateExtIcon;
|
||||
Title = Resources.Microsoft_plugin_timedate_main_page_title;
|
||||
Name = Resources.Microsoft_plugin_timedate_main_page_name;
|
||||
PlaceholderText = Resources.Microsoft_plugin_timedate_placeholder_text;
|
||||
|
||||
@@ -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.WebSearch.Helpers;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
using BrowserInfo = Microsoft.CmdPal.Ext.WebSearch.Helpers.DefaultBrowserInfo;
|
||||
@@ -11,17 +10,14 @@ namespace Microsoft.CmdPal.Ext.WebSearch.Commands;
|
||||
|
||||
internal sealed partial class OpenURLCommand : InvokableCommand
|
||||
{
|
||||
private readonly SettingsManager _settingsManager;
|
||||
|
||||
public string Url { get; internal set; } = string.Empty;
|
||||
|
||||
internal OpenURLCommand(string url, SettingsManager settingsManager)
|
||||
internal OpenURLCommand(string url)
|
||||
{
|
||||
Url = url;
|
||||
BrowserInfo.UpdateIfTimePassed();
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WebSearch.png");
|
||||
Icon = Icons.WebSearch;
|
||||
Name = string.Empty;
|
||||
_settingsManager = settingsManager;
|
||||
}
|
||||
|
||||
public override CommandResult Invoke()
|
||||
|
||||
@@ -21,7 +21,7 @@ internal sealed partial class SearchWebCommand : InvokableCommand
|
||||
{
|
||||
Arguments = arguments;
|
||||
BrowserInfo.UpdateIfTimePassed();
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WebSearch.png");
|
||||
Icon = Icons.WebSearch;
|
||||
Name = Properties.Resources.open_in_default_browser;
|
||||
_settingsManager = settingsManager;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ internal sealed partial class FallbackExecuteSearchItem : FallbackCommandItem
|
||||
Title = string.Empty;
|
||||
_executeItem.Name = string.Empty;
|
||||
Subtitle = string.Format(CultureInfo.CurrentCulture, PluginOpen, BrowserInfo.Name ?? BrowserInfo.MSEdgeName);
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WebSearch.png");
|
||||
Icon = Icons.WebSearch;
|
||||
}
|
||||
|
||||
public override void UpdateQuery(string query)
|
||||
|
||||
@@ -19,13 +19,13 @@ internal sealed partial class FallbackOpenURLItem : FallbackCommandItem
|
||||
private static readonly CompositeFormat PluginOpenUrlInBrowser = System.Text.CompositeFormat.Parse(Properties.Resources.plugin_open_url_in_browser);
|
||||
|
||||
public FallbackOpenURLItem(SettingsManager settings)
|
||||
: base(new OpenURLCommand(string.Empty, settings), Properties.Resources.open_url_fallback_title)
|
||||
: base(new OpenURLCommand(string.Empty), Properties.Resources.open_url_fallback_title)
|
||||
{
|
||||
_executeItem = (OpenURLCommand)this.Command!;
|
||||
Title = string.Empty;
|
||||
_executeItem.Name = string.Empty;
|
||||
Subtitle = string.Empty;
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WebSearch.png");
|
||||
Icon = Icons.WebSearch;
|
||||
}
|
||||
|
||||
public override void UpdateQuery(string query)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// 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.WebSearch;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo WebSearch { get; } = IconHelpers.FromRelativePath("Assets\\WebSearch.png");
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public partial class WebSearchCommandsProvider : CommandProvider
|
||||
{
|
||||
Id = "WebSearch";
|
||||
DisplayName = Resources.extension_name;
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WebSearch.png");
|
||||
Icon = Icons.WebSearch;
|
||||
Settings = _settingsManager.Settings;
|
||||
|
||||
_fallbackItem = new FallbackExecuteSearchItem(_settingsManager);
|
||||
|
||||
@@ -20,7 +20,7 @@ public partial class WebSearchTopLevelCommandItem : CommandItem, IFallbackHandle
|
||||
public WebSearchTopLevelCommandItem(SettingsManager settingsManager)
|
||||
: base(new WebSearchListPage(settingsManager))
|
||||
{
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WebSearch.png");
|
||||
Icon = Icons.WebSearch;
|
||||
SetDefaultTitle();
|
||||
_settingsManager = settingsManager;
|
||||
}
|
||||
|
||||
24
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.WinGet/Icons.cs
Normal file
24
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.WinGet/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.WinGet;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo WinGetIcon { get; } = IconHelpers.FromRelativePath("Assets\\WinGet.svg");
|
||||
|
||||
internal static IconInfo ExtensionsIcon { get; } = IconHelpers.FromRelativePath("Assets\\Extension.svg");
|
||||
|
||||
internal static IconInfo StoreIcon { get; } = IconHelpers.FromRelativePaths("Assets\\Store.light.svg", "Assets\\Store.dark.svg");
|
||||
|
||||
internal static IconInfo CompletedIcon { get; } = new("\uE930"); // Completed
|
||||
|
||||
internal static IconInfo UpdateIcon { get; } = new("\uE74A"); // Up
|
||||
|
||||
internal static IconInfo DownloadIcon { get; } = new("\uE896"); // Download
|
||||
|
||||
internal static IconInfo DeleteIcon { get; } = new("\uE74D"); // Delete
|
||||
}
|
||||
@@ -24,14 +24,6 @@ public partial class InstallPackageCommand : InvokableCommand
|
||||
|
||||
public PackageInstallCommandState InstallCommandState { get; private set; }
|
||||
|
||||
public static IconInfo CompletedIcon { get; } = new("\uE930"); // Completed
|
||||
|
||||
public static IconInfo UpdateIcon { get; } = new("\uE74A"); // Up
|
||||
|
||||
public static IconInfo DownloadIcon { get; } = new("\uE896"); // Download
|
||||
|
||||
public static IconInfo DeleteIcon { get; } = new("\uE74D"); // Delete
|
||||
|
||||
public event EventHandler<InstallPackageCommand>? InstallStateChanged;
|
||||
|
||||
private static readonly CompositeFormat UninstallingPackage = System.Text.CompositeFormat.Parse(Properties.Resources.winget_uninstalling_package);
|
||||
@@ -69,9 +61,9 @@ public partial class InstallPackageCommand : InvokableCommand
|
||||
{
|
||||
Icon = InstallCommandState switch
|
||||
{
|
||||
PackageInstallCommandState.Install => DownloadIcon,
|
||||
PackageInstallCommandState.Update => UpdateIcon,
|
||||
PackageInstallCommandState.Uninstall => CompletedIcon,
|
||||
PackageInstallCommandState.Install => Icons.DownloadIcon,
|
||||
PackageInstallCommandState.Update => Icons.UpdateIcon,
|
||||
PackageInstallCommandState.Uninstall => Icons.CompletedIcon,
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
Name = InstallCommandState switch
|
||||
|
||||
@@ -190,7 +190,7 @@ public partial class InstallPackageListItem : ListItem
|
||||
CommandContextItem uninstallContextItem = new(installCommand)
|
||||
{
|
||||
IsCritical = true,
|
||||
Icon = InstallPackageCommand.DeleteIcon,
|
||||
Icon = Icons.DeleteIcon,
|
||||
};
|
||||
|
||||
if (WinGetStatics.AppSearchCallback != null)
|
||||
|
||||
@@ -34,17 +34,13 @@ internal sealed partial class WinGetExtensionPage : DynamicListPage, IDisposable
|
||||
|
||||
private IEnumerable<CatalogPackage>? _results;
|
||||
|
||||
public static IconInfo WinGetIcon { get; } = IconHelpers.FromRelativePath("Assets\\WinGet.svg");
|
||||
|
||||
public static IconInfo ExtensionsIcon { get; } = IconHelpers.FromRelativePath("Assets\\Extension.svg");
|
||||
|
||||
public static string ExtensionsTag => "windows-commandpalette-extension";
|
||||
|
||||
private readonly StatusMessage _errorMessage = new() { State = MessageState.Error };
|
||||
|
||||
public WinGetExtensionPage(string tag = "")
|
||||
{
|
||||
Icon = tag == ExtensionsTag ? ExtensionsIcon : WinGetIcon;
|
||||
Icon = tag == ExtensionsTag ? Icons.ExtensionsIcon : Icons.WinGetIcon;
|
||||
Name = Properties.Resources.winget_page_name;
|
||||
_tag = tag;
|
||||
ShowDetails = true;
|
||||
@@ -78,7 +74,7 @@ internal sealed partial class WinGetExtensionPage : DynamicListPage, IDisposable
|
||||
|
||||
EmptyContent = new CommandItem(new NoOpCommand())
|
||||
{
|
||||
Icon = WinGetIcon,
|
||||
Icon = Icons.WinGetIcon,
|
||||
Title = (string.IsNullOrEmpty(SearchText) && !HasTag) ?
|
||||
Properties.Resources.winget_placeholder_text :
|
||||
Properties.Resources.winget_no_packages_found,
|
||||
@@ -189,7 +185,7 @@ internal sealed partial class WinGetExtensionPage : DynamicListPage, IDisposable
|
||||
return [];
|
||||
}
|
||||
|
||||
string searchDebugText = $"{query}{(HasTag ? "+" : string.Empty)}{_tag}";
|
||||
var searchDebugText = $"{query}{(HasTag ? "+" : string.Empty)}{_tag}";
|
||||
Logger.LogDebug($"Starting search for '{searchDebugText}'");
|
||||
HashSet<CatalogPackage> results = new(new PackageIdCompare());
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public partial class WinGetExtensionCommandsProvider : CommandProvider
|
||||
{
|
||||
DisplayName = Properties.Resources.winget_display_name;
|
||||
Id = "WinGet";
|
||||
Icon = WinGetExtensionPage.WinGetIcon;
|
||||
Icon = Icons.WinGetIcon;
|
||||
|
||||
_ = WinGetStatics.Manager;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public partial class WinGetExtensionCommandsProvider : CommandProvider
|
||||
new OpenUrlCommand("ms-windows-store://assoc/?Tags=AppExtension-com.microsoft.commandpalette"))
|
||||
{
|
||||
Title = Properties.Resources.winget_search_store_title,
|
||||
Icon = IconHelpers.FromRelativePaths("Assets\\Store.light.svg", "Assets\\Store.dark.svg"),
|
||||
Icon = Icons.StoreIcon,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
};
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -25,7 +25,7 @@ internal sealed partial class OpenServicesCommand : InvokableCommand
|
||||
{
|
||||
_serviceResult = serviceResult;
|
||||
Name = Resources.wox_plugin_service_open_services;
|
||||
Icon = new IconInfo("\xE8A7"); // OpenInNewWindow icon
|
||||
Icon = Icons.OpenIcon;
|
||||
}
|
||||
|
||||
public override CommandResult Invoke()
|
||||
|
||||
@@ -25,7 +25,7 @@ internal sealed partial class RestartServiceCommand : InvokableCommand
|
||||
{
|
||||
_serviceResult = serviceResult;
|
||||
Name = Resources.wox_plugin_service_restart;
|
||||
Icon = new IconInfo("\xE72C"); // Refresh icon
|
||||
Icon = Icons.RefreshIcon;
|
||||
}
|
||||
|
||||
public override CommandResult Invoke()
|
||||
|
||||
@@ -28,11 +28,11 @@ internal sealed partial class ServiceCommand : InvokableCommand
|
||||
Name = action.ToString();
|
||||
if (serviceResult.IsRunning)
|
||||
{
|
||||
Icon = new IconInfo("\xE71A"); // Stop icon
|
||||
Icon = Icons.StopIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
Icon = new IconInfo("\xEDB5"); // PlayBadge12 icon
|
||||
Icon = Icons.PlayIcon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,16 +73,16 @@ public static class ServiceHelper
|
||||
];
|
||||
}
|
||||
|
||||
IconInfo icon = new("\U0001f7e2"); // unicode LARGE GREEN CIRCLE
|
||||
IconInfo icon = Icons.GreenCircleIcon;
|
||||
switch (s.Status)
|
||||
{
|
||||
case ServiceControllerStatus.Stopped:
|
||||
icon = new("\U0001F534"); // unicode LARGE RED CIRCLE
|
||||
icon = Icons.RedCircleIcon;
|
||||
break;
|
||||
case ServiceControllerStatus.Running:
|
||||
break;
|
||||
case ServiceControllerStatus.Paused:
|
||||
icon = new("\u23F8"); // unicode DOUBLE VERTICAL BAR, aka, "Pause"
|
||||
icon = Icons.PauseIcon;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// 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.WindowsServices;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo ServicesIcon { get; } = IconHelpers.FromRelativePath("Assets\\Services.svg");
|
||||
|
||||
internal static IconInfo StopIcon { get; } = new IconInfo("\xE71A"); // Stop icon
|
||||
|
||||
internal static IconInfo PlayIcon { get; } = new IconInfo("\xEDB5"); // PlayBadge12 icon
|
||||
|
||||
internal static IconInfo RefreshIcon { get; } = new IconInfo("\xE72C"); // Refresh icon
|
||||
|
||||
internal static IconInfo OpenIcon { get; } = new IconInfo("\xE8A7"); // OpenInNewWindow icon
|
||||
|
||||
internal static IconInfo GreenCircleIcon { get; } = new("\U0001f7e2"); // unicode LARGE GREEN CIRCLE
|
||||
|
||||
internal static IconInfo RedCircleIcon { get; } = new("\U0001F534"); // unicode LARGE RED CIRCLE
|
||||
|
||||
internal static IconInfo PauseIcon { get; } = new("\u23F8"); // unicode DOUBLE VERTICAL BAR, aka, "Pause"
|
||||
}
|
||||
@@ -14,7 +14,7 @@ internal sealed partial class ServicesListPage : DynamicListPage
|
||||
{
|
||||
public ServicesListPage()
|
||||
{
|
||||
Icon = WindowsServicesCommandsProvider.ServicesIcon;
|
||||
Icon = Icons.ServicesIcon;
|
||||
Name = "Windows Services";
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,11 @@ namespace Microsoft.CmdPal.Ext.WindowsServices;
|
||||
public partial class WindowsServicesCommandsProvider : CommandProvider
|
||||
{
|
||||
// For giggles, "%windir%\\system32\\filemgmt.dll" also _just works_.
|
||||
public static IconInfo ServicesIcon { get; } = IconHelpers.FromRelativePath("Assets\\Services.svg");
|
||||
|
||||
public WindowsServicesCommandsProvider()
|
||||
{
|
||||
Id = "Windows.Services";
|
||||
DisplayName = Resources.WindowsServicesProvider_DisplayName;
|
||||
Icon = ServicesIcon;
|
||||
Icon = Icons.ServicesIcon;
|
||||
}
|
||||
|
||||
public override ICommandItem[] TopLevelCommands()
|
||||
|
||||
@@ -10,7 +10,6 @@ using System.Resources;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Classes;
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Properties;
|
||||
using Microsoft.CommandPalette.Extensions;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
@@ -27,7 +26,7 @@ internal sealed partial class CopySettingCommand : InvokableCommand
|
||||
internal CopySettingCommand(WindowsSetting entry)
|
||||
{
|
||||
Name = Resources.CopyCommand;
|
||||
Icon = new IconInfo("\xE8C8"); // Copy icon
|
||||
Icon = Icons.CopyIcon;
|
||||
_entry = entry;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ using System.Resources;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Classes;
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Properties;
|
||||
using Microsoft.CommandPalette.Extensions;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
@@ -27,7 +26,7 @@ internal sealed partial class OpenSettingsCommand : InvokableCommand
|
||||
internal OpenSettingsCommand(WindowsSetting entry)
|
||||
{
|
||||
Name = Resources.OpenSettings;
|
||||
Icon = new IconInfo("\xE8C8");
|
||||
Icon = Icons.CopyIcon;
|
||||
_entry = entry;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Commands;
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Properties;
|
||||
@@ -30,7 +29,7 @@ internal static class ResultHelper
|
||||
{
|
||||
var result = new ListItem(new OpenSettingsCommand(entry))
|
||||
{
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg"),
|
||||
Icon = Icons.WindowsSettingsIcon,
|
||||
Subtitle = entry.JoinedFullSettingsPath,
|
||||
Title = entry.Name,
|
||||
MoreCommands = ContextMenuHelper.GetContextMenu(entry).ToArray(),
|
||||
|
||||
@@ -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.WindowsSettings;
|
||||
|
||||
internal sealed class Icons
|
||||
{
|
||||
internal static IconInfo WindowsSettingsIcon { get; } = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
|
||||
|
||||
internal static IconInfo CopyIcon { get; } = new IconInfo("\xE8C8"); // Copy icon
|
||||
}
|
||||
@@ -24,7 +24,7 @@ internal sealed partial class FallbackWindowsSettingsItem : FallbackCommandItem
|
||||
public FallbackWindowsSettingsItem(Classes.WindowsSettings windowsSettings)
|
||||
: base(new NoOpCommand(), Resources.settings_title)
|
||||
{
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
|
||||
Icon = Icons.WindowsSettingsIcon;
|
||||
_windowsSettings = windowsSettings;
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ internal sealed partial class FallbackWindowsSettingsItem : FallbackCommandItem
|
||||
|
||||
Title = setting.Name;
|
||||
Subtitle = setting.JoinedFullSettingsPath;
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
|
||||
Icon = Icons.WindowsSettingsIcon;
|
||||
Command = new OpenSettingsCommand(setting)
|
||||
{
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg"),
|
||||
Icon = Icons.WindowsSettingsIcon,
|
||||
Name = setting.Name,
|
||||
};
|
||||
|
||||
@@ -80,7 +80,7 @@ internal sealed partial class FallbackWindowsSettingsItem : FallbackCommandItem
|
||||
// us to the Windows Settings search page, prepopulated with this search.
|
||||
var settingsPage = new WindowsSettingsListPage(_windowsSettings, query);
|
||||
Title = string.Format(CultureInfo.CurrentCulture, _title, query);
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
|
||||
Icon = Icons.WindowsSettingsIcon;
|
||||
Subtitle = _subtitle;
|
||||
Command = settingsPage;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ internal sealed partial class WindowsSettingsListPage : DynamicListPage
|
||||
|
||||
public WindowsSettingsListPage(Classes.WindowsSettings windowsSettings)
|
||||
{
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
|
||||
Icon = Icons.WindowsSettingsIcon;
|
||||
Name = Resources.settings_title;
|
||||
Id = "com.microsoft.cmdpal.windowsSettings";
|
||||
_windowsSettings = windowsSettings;
|
||||
|
||||
@@ -24,7 +24,7 @@ public partial class WindowsSettingsCommandsProvider : CommandProvider
|
||||
{
|
||||
Id = "Windows.Settings";
|
||||
DisplayName = Resources.WindowsSettingsProvider_DisplayName;
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
|
||||
Icon = Icons.WindowsSettingsIcon;
|
||||
|
||||
_windowsSettings = JsonSettingsListHelper.ReadAllPossibleSettings();
|
||||
_searchSettingsListItem = new CommandItem(new WindowsSettingsListPage(_windowsSettings))
|
||||
|
||||
@@ -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