HeadMeld 0.0.0.1

- Initial submit, functionality is incomplete
This commit is contained in:
2022-03-27 11:04:13 +01:00
commit ae9fbc6d97
23 changed files with 613 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
using System;
using System.Windows.Forms;
namespace HeadMeld
{
internal class TrayManager
{
NotifyIcon notifyIcon = new();
public bool UseHeadphoneMode { get; set; } = true;
public bool UseDarkMode { get; set; }
public TrayManager() => notifyIcon.Click += NotifyIcon_Click;
public void Create()
{
notifyIcon.Visible = true;
}
public void Destroy()
{
notifyIcon.Visible = false;
notifyIcon.Dispose();
}
public void UpdateTrayIcon()
{
if (UseHeadphoneMode == true)
{
if (UseDarkMode == true)
notifyIcon.Icon = new System.Drawing.Icon("Resources/headphones_light.ico");
else
notifyIcon.Icon = new System.Drawing.Icon("Resources/headphones_dark.ico");
}
else if (UseHeadphoneMode == false)
{
if (UseDarkMode == true)
notifyIcon.Icon = new System.Drawing.Icon("Resources/loudspeakers_light.ico");
else
notifyIcon.Icon = new System.Drawing.Icon("Resources/loudspeakers_dark.ico");
}
}
public event EventHandler ToggleWindowState;
private void NotifyIcon_Click(object? sender, EventArgs e)
{
ToggleWindowState?.Invoke(this, EventArgs.Empty);
}
}
}