mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 15:55:39 +02:00
Fixed: minimize to try
This commit is contained in:
@@ -648,6 +648,7 @@
|
||||
this.Text = "Perun for DCS";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.form_Main_FormClosing);
|
||||
this.Load += new System.EventHandler(this.form_Main_Load);
|
||||
this.Resize += new System.EventHandler(this.form_Main_Resize);
|
||||
this.con_GroupBox_1.ResumeLayout(false);
|
||||
this.con_GroupBox_1.PerformLayout();
|
||||
this.con_GroupBox_2.ResumeLayout(false);
|
||||
|
||||
@@ -356,6 +356,7 @@ namespace Perun_v1
|
||||
// Changed close to try state
|
||||
Properties.Settings.Default.CLOSE_TO_TRAY = con_check_minimize_to_tray.Checked;
|
||||
}
|
||||
|
||||
// ################################ Form state ################################
|
||||
private void con_Button_Quit_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -407,15 +408,9 @@ namespace Perun_v1
|
||||
if (e.CloseReason == CloseReason.UserClosing && !AppCanClose)
|
||||
{
|
||||
e.Cancel = true;
|
||||
if (Properties.Settings.Default.CLOSE_TO_TRAY)
|
||||
{
|
||||
form_Main_SendToTray(); // Send app to system tray
|
||||
} else
|
||||
{
|
||||
con_Button_Quit_Click(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void trayIconMain_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
@@ -423,6 +418,17 @@ namespace Perun_v1
|
||||
form_Main_BringFromTray(); // Bring app from system tray
|
||||
}
|
||||
|
||||
private void form_Main_Resize(object sender, EventArgs e)
|
||||
{
|
||||
// Form was minimised to try
|
||||
if (WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
if (con_check_minimize_to_tray.Checked)
|
||||
{
|
||||
form_Main_SendToTray();
|
||||
}
|
||||
}
|
||||
}
|
||||
// ################################ Timers ################################
|
||||
private void Tim_GUI_Tick(object sender, EventArgs e)
|
||||
{
|
||||
@@ -716,5 +722,6 @@ namespace Perun_v1
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user