From db934e70cb1576f05c989585c42e7d879ca1b030 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 8 Jan 2025 20:35:33 +0800 Subject: [PATCH] The icon of the system proxy can be customized https://github.com/2dust/v2rayN/issues/6459 --- v2rayN/v2rayN.Desktop/Common/AvaUtils.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/v2rayN/v2rayN.Desktop/Common/AvaUtils.cs b/v2rayN/v2rayN.Desktop/Common/AvaUtils.cs index 30e8ecc8..bd5c5906 100644 --- a/v2rayN/v2rayN.Desktop/Common/AvaUtils.cs +++ b/v2rayN/v2rayN.Desktop/Common/AvaUtils.cs @@ -40,6 +40,12 @@ namespace v2rayN.Desktop.Common 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);