Skip to content

Commit

Permalink
The icon of the system proxy can be customized
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Jan 8, 2025
1 parent b770048 commit db934e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions v2rayN/v2rayN.Desktop/Common/AvaUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public static async Task SetClipboardData(Visual? visual, string strData)
public static WindowIcon GetAppIcon(ESysProxyType sysProxyType)
{
var index = (int)sysProxyType + 1;
var fileName = Utils.GetPath($"NotifyIcon{index}.ico");
if (File.Exists(fileName))
{
return new(fileName);
}

var uri = new Uri(Path.Combine(Global.AvaAssets, $"NotifyIcon{index}.ico"));
using var bitmap = new Bitmap(AssetLoader.Open(uri));
return new(bitmap);
Expand Down

0 comments on commit db934e7

Please sign in to comment.