mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[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 commitf492c4efdb. * Revert "Added theme awereness based on somil55s PR" This reverts commit8edd3226be. * 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:
@@ -8,7 +8,7 @@ namespace Microsoft.Plugin.WindowWalker
|
||||
public class Main : IPlugin, IPluginI18n
|
||||
{
|
||||
private static List<SearchResult> _results = new List<SearchResult>();
|
||||
private static string IcoPath = "Images/windowwalker.png";
|
||||
private string IconPath { get; set; }
|
||||
private PluginInitContext Context { get; set; }
|
||||
|
||||
static Main()
|
||||
@@ -24,7 +24,7 @@ namespace Microsoft.Plugin.WindowWalker
|
||||
return _results.Select(x => new Result()
|
||||
{
|
||||
Title = x.Result.Title,
|
||||
IcoPath = IcoPath,
|
||||
IcoPath = IconPath,
|
||||
SubTitle = "Running: " + x.Result.ProcessName,
|
||||
Action = c =>
|
||||
{
|
||||
@@ -37,7 +37,27 @@ namespace Microsoft.Plugin.WindowWalker
|
||||
|
||||
public void Init(PluginInitContext context)
|
||||
{
|
||||
Context = context;
|
||||
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/windowwalker.light.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
IconPath = "Images/windowwalker.dark.png";
|
||||
}
|
||||
}
|
||||
|
||||
private void OnThemeChanged(Theme _, Theme newTheme)
|
||||
{
|
||||
UpdateIconPath(newTheme);
|
||||
}
|
||||
|
||||
public string GetTranslatedPluginTitle()
|
||||
|
||||
Reference in New Issue
Block a user