Files
gatuna/win/gatuna-client/Program.cs
T
mute d1e71f0323 restore standard window controls, minimize-to-tray, close-exits
- Restore default FormBorderStyle (resizable with min/max/close buttons)
- Minimize button hides to tray (WindowState=Minimized -> Hide())
- Close button and tray Exit both call Shutdown() then close normally
- Tray Show/DoubleClick restores window from tray
2026-08-13 08:11:16 +00:00

42 lines
992 B
C#

namespace gatuna_client;
static class Program
{
[STAThread]
static void Main()
{
ApplicationConfiguration.Initialize();
var form = new MainForm();
using var tray = new NotifyIcon
{
Icon = SystemIcons.Application,
Text = "gatuna",
Visible = true,
};
tray.ContextMenuStrip = new ContextMenuStrip();
tray.ContextMenuStrip.Items.Add("Show", null, (_, _) =>
{
form.Show();
form.WindowState = FormWindowState.Normal;
form.Activate();
});
tray.ContextMenuStrip.Items.Add("-");
tray.ContextMenuStrip.Items.Add("Exit", null, (_, _) =>
{
tray.Visible = false;
form.Close();
});
tray.DoubleClick += (_, _) =>
{
form.Show();
form.WindowState = FormWindowState.Normal;
form.Activate();
};
Application.Run(form);
}
}