[PowerToys Run] Updated (plugin) icons with MDL2 (#4149)

* Updated (plugin) icons with MDL2

* Image wasn't updating

* Based on feedback, updated app icon and windowwalker icon

* Updated app icon

* Updated Window Walker icon

* Change build action / Copy to output directory to None and Do Not Copy - like it was originally

* Fix

* Fix

* Resized images

* Added theme awereness based on somil55s PR

* Added theming to Shell and WindowWalker

* Revert "Added theming to Shell and WindowWalker"

This reverts commit f492c4efdb.

* Revert "Added theme awereness based on somil55s PR"

This reverts commit 8edd3226be.

* Typo fix

* Added new theming support for the new Calculator, Shell and WindowWalker icons

* Added Unit test reference back in
This commit is contained in:
Niels Laute
2020-07-14 07:59:19 +02:00
committed by GitHub
parent 01ca13cccb
commit 5f0e8d3d8e
72 changed files with 185 additions and 97 deletions

View File

@@ -24,7 +24,7 @@ namespace Microsoft.Plugin.Shell
{
public class Main : IPlugin, ISettingProvider, IPluginI18n, IContextMenu, ISavable
{
private const string Image = "Images/shell.png";
private string IconPath { get; set; }
private PluginInitContext _context;
private bool _winRStroked;
private readonly KeyboardSimulator _keyboardSimulator = new KeyboardSimulator(new InputSimulator());
@@ -87,7 +87,7 @@ namespace Microsoft.Plugin.Shell
results.AddRange(autocomplete.ConvertAll(m => new Result
{
Title = m,
IcoPath = Image,
IcoPath = IconPath,
Action = c =>
{
Execute(Process.Start, PrepareProcessStartInfo(m));
@@ -120,7 +120,7 @@ namespace Microsoft.Plugin.Shell
{
Title = m.Key,
SubTitle = "Shell: " + string.Format(_context.API.GetTranslation("wox_plugin_cmd_cmd_has_been_executed_times"), m.Value),
IcoPath = Image,
IcoPath = IconPath,
Action = c =>
{
Execute(Process.Start, PrepareProcessStartInfo(m.Key));
@@ -139,7 +139,7 @@ namespace Microsoft.Plugin.Shell
Title = cmd,
Score = 5000,
SubTitle = "Shell: " + _context.API.GetTranslation("wox_plugin_cmd_execute_through_shell"),
IcoPath = Image,
IcoPath = IconPath,
Action = c =>
{
Execute(Process.Start, PrepareProcessStartInfo(cmd));
@@ -157,7 +157,7 @@ namespace Microsoft.Plugin.Shell
{
Title = m.Key,
SubTitle = "Shell: " + string.Format(_context.API.GetTranslation("wox_plugin_cmd_cmd_has_been_executed_times"), m.Value),
IcoPath = Image,
IcoPath = IconPath,
Action = c =>
{
Execute(Process.Start, PrepareProcessStartInfo(m.Key));
@@ -288,6 +288,26 @@ namespace Microsoft.Plugin.Shell
public void Init(PluginInitContext context)
{
this._context = context;
_context.API.ThemeChanged += OnThemeChanged;
UpdateIconPath(_context.API.GetCurrentTheme());
}
// Todo : Update with theme based IconPath
private void UpdateIconPath(Theme theme)
{
if (theme == Theme.Light || theme == Theme.HighContrastWhite)
{
IconPath = "Images/shell.light.png";
}
else
{
IconPath = "Images/shell.dark.png";
}
}
private void OnThemeChanged(Theme _, Theme newTheme)
{
UpdateIconPath(newTheme);
}
bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state)