Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added v2rayN/v2rayN.Desktop/Assets/NotifyIcon4.ico
Binary file not shown.
5 changes: 4 additions & 1 deletion v2rayN/v2rayN.Desktop/Common/AvaUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ public static WindowIcon GetAppIcon(ESysProxyType sysProxyType)
break;

case ESysProxyType.ForcedChange:
case ESysProxyType.Pac:
index = 2;
break;

case ESysProxyType.Unchanged:
index = 3;
break;

case ESysProxyType.Pac:
index = 4;
break;
}
var uri = new Uri($"avares://{Assembly.GetExecutingAssembly().GetName().Name}/Assets/NotifyIcon{index}.ico");
using var bitmap = new Bitmap(AssetLoader.Open(uri));
Expand Down
7 changes: 5 additions & 2 deletions v2rayN/v2rayN/Handler/WindowsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task<Icon> GetNotifyIcon(Config config)
0 => Properties.Resources.NotifyIcon1,
1 => Properties.Resources.NotifyIcon2,
2 => Properties.Resources.NotifyIcon3,
3 => Properties.Resources.NotifyIcon2,
3 => Properties.Resources.NotifyIcon4,
_ => Properties.Resources.NotifyIcon1, // default
};
}
Expand All @@ -54,13 +54,16 @@ public System.Windows.Media.ImageSource GetAppIcon(Config config)
break;

case ESysProxyType.ForcedChange:
case ESysProxyType.Pac:
index = 2;
break;

case ESysProxyType.Unchanged:
index = 3;
break;

case ESysProxyType.Pac:
index = 4;
break;
}
return BitmapFrame.Create(new Uri($"pack://application:,,,/Resources/NotifyIcon{index}.ico", UriKind.RelativeOrAbsolute));
}
Expand Down
10 changes: 10 additions & 0 deletions v2rayN/v2rayN/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions v2rayN/v2rayN/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,7 @@
<data name="NotifyIcon3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\NotifyIcon3.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NotifyIcon4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\NotifyIcon4.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added v2rayN/v2rayN/Resources/NotifyIcon4.ico
Binary file not shown.
1 change: 1 addition & 0 deletions v2rayN/v2rayN/v2rayN.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<Resource Include="Resources\NotifyIcon1.ico" />
<Resource Include="Resources\NotifyIcon2.ico" />
<Resource Include="Resources\NotifyIcon3.ico" />
<Resource Include="Resources\NotifyIcon4.ico" />
<Resource Include="Resources\v2rayN.ico" />
</ItemGroup>

Expand Down