From 502f10c533a0603f0df66929296661fb945ac4cb Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 13 Mar 2019 17:52:59 +0200 Subject: [PATCH] open from tray on single click --- YAPA/Plugins/MinimizeToTray/SystemTray.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/YAPA/Plugins/MinimizeToTray/SystemTray.cs b/YAPA/Plugins/MinimizeToTray/SystemTray.cs index 01dba9f..ff1cac9 100644 --- a/YAPA/Plugins/MinimizeToTray/SystemTray.cs +++ b/YAPA/Plugins/MinimizeToTray/SystemTray.cs @@ -7,6 +7,7 @@ using System.Windows.Forms; using System.Windows.Input; using YAPA.Shared.Contracts; +using MouseEventArgs = System.Windows.Forms.MouseEventArgs; namespace YAPA.Plugins.MinimizeToTray { @@ -51,7 +52,7 @@ public SystemTray(IApplication app, IMainViewModel viewModel, SystemTraySettings Visible = SystemTrayVisible() }; - _sysTrayIcon.DoubleClick += SysTrayIcon_DoubleClick; + _sysTrayIcon.MouseClick += SysTrayIcon_MouseClick; _viewModel.Engine.PropertyChanged += _engine_PropertyChanged; @@ -197,8 +198,11 @@ private void _app_StateChanged(ApplicationState state) } } - private void SysTrayIcon_DoubleClick(object sender, EventArgs e) + private void SysTrayIcon_MouseClick(object sender, MouseEventArgs e) { + if (e.Button != MouseButtons.Left) + return; + _app.Show(); _app.AppState = ApplicationState.Normal; }