mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Tray notification icon dot
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user