mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-06 03:07:54 +08:00
Save icons using GUID filename
This commit is contained in:
parent
a5d63bc383
commit
10204a4526
@ -51,9 +51,9 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
|
|
||||||
foreach (ControlPanelItem item in controlPanelItems)
|
foreach (ControlPanelItem item in controlPanelItems)
|
||||||
{
|
{
|
||||||
if (!File.Exists(iconFolder + item.LocalizedString + fileType) && item.Icon != null)
|
if (!File.Exists(iconFolder + item.GUID + fileType) && item.Icon != null)
|
||||||
{
|
{
|
||||||
item.Icon.ToBitmap().Save(iconFolder + item.LocalizedString + fileType);
|
item.Icon.ToBitmap().Save(iconFolder + item.GUID + fileType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
Title = item.LocalizedString,
|
Title = item.LocalizedString,
|
||||||
SubTitle = item.InfoTip,
|
SubTitle = item.InfoTip,
|
||||||
Score = item.Score,
|
Score = item.Score,
|
||||||
IcoPath = "Images\\ControlPanelIcons\\" + item.LocalizedString + fileType,
|
IcoPath = "Images\\ControlPanelIcons\\" + item.GUID + fileType,
|
||||||
Action = e =>
|
Action = e =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -8,16 +8,18 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
{
|
{
|
||||||
public string LocalizedString { get; private set; }
|
public string LocalizedString { get; private set; }
|
||||||
public string InfoTip { get; private set; }
|
public string InfoTip { get; private set; }
|
||||||
|
public string GUID { get; private set; }
|
||||||
public ProcessStartInfo ExecutablePath { get; private set; }
|
public ProcessStartInfo ExecutablePath { get; private set; }
|
||||||
public Icon Icon { get; private set; }
|
public Icon Icon { get; private set; }
|
||||||
public int Score { get; set; }
|
public int Score { get; set; }
|
||||||
|
|
||||||
public ControlPanelItem(string newLocalizedString, string newInfoTip, ProcessStartInfo newExecutablePath, Icon newIcon)
|
public ControlPanelItem(string newLocalizedString, string newInfoTip, string newGUID, ProcessStartInfo newExecutablePath, Icon newIcon)
|
||||||
{
|
{
|
||||||
LocalizedString = newLocalizedString;
|
LocalizedString = newLocalizedString;
|
||||||
InfoTip = newInfoTip;
|
InfoTip = newInfoTip;
|
||||||
ExecutablePath = newExecutablePath;
|
ExecutablePath = newExecutablePath;
|
||||||
Icon = newIcon;
|
Icon = newIcon;
|
||||||
|
GUID = newGUID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
|
|
||||||
myIcon = getIcon(currentKey, size);
|
myIcon = getIcon(currentKey, size);
|
||||||
|
|
||||||
controlPanelItems.Add(new ControlPanelItem(localizedString, infoTip, executablePath, myIcon));
|
controlPanelItems.Add(new ControlPanelItem(localizedString, infoTip, key, executablePath, myIcon));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user