Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open from tray on single click, #44 #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions YAPA/Plugins/MinimizeToTray/SystemTray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down