From 719c7f3350e4829e32a8fac221b1c51193d28a63 Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Fri, 23 Apr 2021 17:41:59 +1200 Subject: [PATCH] Updated minimise checkbox to also boot Made the MainForm's minimise checkbox also start DisplayMagician on boot. --- DisplayMagician/UIForms/MainForm.Designer.cs | 1 + DisplayMagician/UIForms/MainForm.cs | 15 +++++++++++++++ DisplayMagician/UIForms/MainForm.resx | 14 +++++++------- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/DisplayMagician/UIForms/MainForm.Designer.cs b/DisplayMagician/UIForms/MainForm.Designer.cs index b87d0e9..d78e85f 100644 --- a/DisplayMagician/UIForms/MainForm.Designer.cs +++ b/DisplayMagician/UIForms/MainForm.Designer.cs @@ -190,6 +190,7 @@ // resources.ApplyResources(this.notifyIcon, "notifyIcon"); this.notifyIcon.ContextMenuStrip = this.mainContextMenuStrip; + this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseDoubleClick); // // mainContextMenuStrip // diff --git a/DisplayMagician/UIForms/MainForm.cs b/DisplayMagician/UIForms/MainForm.cs index 8686ef6..822de40 100644 --- a/DisplayMagician/UIForms/MainForm.cs +++ b/DisplayMagician/UIForms/MainForm.cs @@ -68,6 +68,14 @@ namespace DisplayMagician.UIForms allowVisible = true; // Really close the application when the form is closed allowClose = true; + } + + if (Program.AppProgramSettings.MinimiseOnStart && Program.AppProgramSettings.StartOnBootUp) + { + cb_minimise_notification_area.Checked = true; + } + else + { cb_minimise_notification_area.Checked = false; } @@ -320,6 +328,7 @@ namespace DisplayMagician.UIForms allowClose = false; // Enable the MinimiseOnStart setting Program.AppProgramSettings.MinimiseOnStart = true; + Program.AppProgramSettings.StartOnBootUp = true; // Change the exit_button text to say 'Close' btn_exit.Text = "&Close"; } @@ -331,6 +340,7 @@ namespace DisplayMagician.UIForms allowClose = true; // Disable the MinimiseOnStart setting Program.AppProgramSettings.MinimiseOnStart = false; + Program.AppProgramSettings.StartOnBootUp = false; // Change the exit_button text to say 'Exit' btn_exit.Text = "&Exit"; @@ -475,5 +485,10 @@ namespace DisplayMagician.UIForms string targetURL = @"https://github.com/sponsors/terrymacdonald"; System.Diagnostics.Process.Start(targetURL); } + + private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e) + { + openApplicationWindow(); + } } } diff --git a/DisplayMagician/UIForms/MainForm.resx b/DisplayMagician/UIForms/MainForm.resx index 4aa5997..1c60060 100644 --- a/DisplayMagician/UIForms/MainForm.resx +++ b/DisplayMagician/UIForms/MainForm.resx @@ -10837,7 +10837,7 @@ NoControl - 282, 245 + 282, 247 222, 22 @@ -10879,16 +10879,16 @@ NoControl - 234, 353 + 162, 356 - 332, 20 + 460, 20 5 - Start DisplayMagician minimised in notification area + Start DisplayMagician minimised in notification area when computer starts cb_minimise_notification_area @@ -10912,7 +10912,7 @@ Microsoft Sans Serif, 9.75pt - 12, 354 + 12, 357 25, 16 @@ -10948,7 +10948,7 @@ Microsoft Sans Serif, 21.75pt - 212, 172 + 212, 174 360, 50 @@ -10981,7 +10981,7 @@ NoControl - 700, 350 + 700, 353 75, 23