mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 18:05:40 +02:00
Fixed: minimize to try
This commit is contained in:
@@ -648,6 +648,7 @@
|
|||||||
this.Text = "Perun for DCS";
|
this.Text = "Perun for DCS";
|
||||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.form_Main_FormClosing);
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.form_Main_FormClosing);
|
||||||
this.Load += new System.EventHandler(this.form_Main_Load);
|
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.ResumeLayout(false);
|
||||||
this.con_GroupBox_1.PerformLayout();
|
this.con_GroupBox_1.PerformLayout();
|
||||||
this.con_GroupBox_2.ResumeLayout(false);
|
this.con_GroupBox_2.ResumeLayout(false);
|
||||||
|
|||||||
@@ -356,6 +356,7 @@ namespace Perun_v1
|
|||||||
// Changed close to try state
|
// Changed close to try state
|
||||||
Properties.Settings.Default.CLOSE_TO_TRAY = con_check_minimize_to_tray.Checked;
|
Properties.Settings.Default.CLOSE_TO_TRAY = con_check_minimize_to_tray.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ################################ Form state ################################
|
// ################################ Form state ################################
|
||||||
private void con_Button_Quit_Click(object sender, EventArgs e)
|
private void con_Button_Quit_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -407,15 +408,9 @@ namespace Perun_v1
|
|||||||
if (e.CloseReason == CloseReason.UserClosing && !AppCanClose)
|
if (e.CloseReason == CloseReason.UserClosing && !AppCanClose)
|
||||||
{
|
{
|
||||||
e.Cancel = true;
|
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);
|
con_Button_Quit_Click(sender, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void trayIconMain_MouseDoubleClick(object sender, MouseEventArgs e)
|
private void trayIconMain_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -423,6 +418,17 @@ namespace Perun_v1
|
|||||||
form_Main_BringFromTray(); // Bring app from system tray
|
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 ################################
|
// ################################ Timers ################################
|
||||||
private void Tim_GUI_Tick(object sender, EventArgs e)
|
private void Tim_GUI_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -709,12 +715,13 @@ namespace Perun_v1
|
|||||||
{
|
{
|
||||||
// Handle autostart parameter from command line
|
// Handle autostart parameter from command line
|
||||||
TIM_Autostart.Enabled = false; // Disable timer
|
TIM_Autostart.Enabled = false; // Disable timer
|
||||||
con_Button_Listen_ON_Click(sender,e); // Simulate button click
|
con_Button_Listen_ON_Click(sender, e); // Simulate button click
|
||||||
}
|
}
|
||||||
|
|
||||||
private void label16_Click(object sender, EventArgs e)
|
private void label16_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user