Tray notification icon dot

This commit is contained in:
Natsumi
2025-10-30 01:16:17 +11:00
parent 814a66abea
commit 3836b9b4ce
15 changed files with 90 additions and 35 deletions

View File

@@ -7,7 +7,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Reflection;
using System.IO;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
@@ -22,6 +22,8 @@ namespace VRCX
public static NativeWindow nativeWindow;
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public ChromiumWebBrowser Browser;
private readonly Icon _appIcon;
private readonly Icon _appIconNoty;
private readonly Timer _saveTimer;
private int LastLocationX;
private int LastLocationY;
@@ -41,10 +43,11 @@ namespace VRCX
_saveTimer.Tick += SaveTimer_Tick;
try
{
var location = Assembly.GetExecutingAssembly().Location;
var icon = Icon.ExtractAssociatedIcon(location);
Icon = icon;
TrayIcon.Icon = icon;
var path = Path.GetDirectoryName(Environment.ProcessPath) ?? string.Empty;
_appIcon = new Icon(Path.Combine(path, "VRCX.ico"));
_appIconNoty = new Icon(Path.Combine(path, "VRCX_notify.ico"));
Icon = _appIcon;
TrayIcon.Icon = _appIcon;
}
catch (Exception ex)
{
@@ -246,5 +249,10 @@ namespace VRCX
SaveWindowState();
Application.Exit();
}
public void SetTrayIconNotification(bool notify)
{
TrayIcon.Icon = notify ? _appIconNoty : _appIcon;
}
}
}