Skip to content

Commit dd8a92c

Browse files
author
Delta-Kronecker
committed
ui: single-click tray restores window; '-' button minimizes to taskbar only
1 parent 15964d3 commit dd8a92c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scripts/TorJetUi.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,10 @@ public MainForm()
376376
trayIcon.Text = "TorJet";
377377
trayIcon.Icon = LoadAppIcon() ?? CreateTrayIcon();
378378
trayIcon.ContextMenuStrip = trayMenu;
379-
trayIcon.DoubleClick += delegate { ShowFromTray(); };
379+
trayIcon.MouseClick += delegate(object s, MouseEventArgs e)
380+
{
381+
if (e.Button == MouseButtons.Left) ShowFromTray();
382+
};
380383

381384
Icon appIcon = LoadAppIcon() ?? CreateTrayIcon();
382385
Icon = appIcon;
@@ -1028,7 +1031,7 @@ private void OnMouseDownAll(object s, MouseEventArgs e)
10281031
switch (h)
10291032
{
10301033
case 1: HandleCloseRequest(); break;
1031-
case 2: MinimizeToTray(); break;
1034+
case 2: WindowState = FormWindowState.Minimized; break;
10321035
case 5: OnConnectButton(); break;
10331036
case 20: ApplyProxyToggle(!ProxyIsOurs()); break;
10341037
case 30: page = Page.Settings; settingsScrollY = 0; CancelEdit(); LayoutPass(); Invalidate(); break;

0 commit comments

Comments
 (0)