fix legacy icon resource name

This commit is contained in:
Kang Yu 2024-02-03 14:23:54 -08:00
parent 163996b98f
commit 66460e2de8
4 changed files with 24 additions and 5 deletions

View file

@ -242,9 +242,9 @@ namespace PersistentWindows.SystrayShell
AppdataFolder = appDataFolder; AppdataFolder = appDataFolder;
// default icons // default icons
IdleIcon = legacy_icon ? Properties.Resources.pwIconLegacy : Properties.Resources.pwIcon; IdleIcon = legacy_icon ? Properties.Resources.pwIcon2 : Properties.Resources.pwIcon;
var iconHandle = Properties.Resources.pwIconBusy.GetHicon(); var iconHandle = Properties.Resources.pwIconBusy.GetHicon();
BusyIcon = legacy_icon ? Properties.Resources.pwIconBusyLegacy : System.Drawing.Icon.FromHandle(iconHandle); BusyIcon = legacy_icon ? Properties.Resources.pwIconBusy2 : System.Drawing.Icon.FromHandle(iconHandle);
iconHandle = Properties.Resources.pwIconUpdate.GetHicon(); iconHandle = Properties.Resources.pwIconUpdate.GetHicon();
UpdateIcon = System.Drawing.Icon.FromHandle(iconHandle); UpdateIcon = System.Drawing.Icon.FromHandle(iconHandle);

View file

@ -70,13 +70,16 @@ namespace PersistentWindows.SystrayShell.Properties {
} }
} }
internal static System.Drawing.Icon pwIconLegacy { /// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon pwIcon2 {
get { get {
object obj = ResourceManager.GetObject("pwIcon2", resourceCulture); object obj = ResourceManager.GetObject("pwIcon2", resourceCulture);
return ((System.Drawing.Icon)(obj)); return ((System.Drawing.Icon)(obj));
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
@ -86,7 +89,11 @@ namespace PersistentWindows.SystrayShell.Properties {
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Icon pwIconBusyLegacy {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon pwIconBusy2 {
get { get {
object obj = ResourceManager.GetObject("pwIconBusy2", resourceCulture); object obj = ResourceManager.GetObject("pwIconBusy2", resourceCulture);
return ((System.Drawing.Icon)(obj)); return ((System.Drawing.Icon)(obj));

View file

@ -121,9 +121,15 @@
<data name="pwIcon" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="pwIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pwIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\pwIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="pwIcon2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pwIcon2.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pwIconBusy" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="pwIconBusy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pwIconBusy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\pwIconBusy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="pwIconBusy2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pwIconBusy2.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pwIconUpdate" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="pwIconUpdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pwIconUpdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\pwIconUpdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>

View file

@ -129,6 +129,12 @@
<ItemGroup> <ItemGroup>
<None Include="Resources\pwIconUpdate.png" /> <None Include="Resources\pwIconUpdate.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\pwIcon2.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\pwIconBusy2.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>copy $(SolutionDir)*.bat $(TargetDir) <PostBuildEvent>copy $(SolutionDir)*.bat $(TargetDir)