Added screenshot delay shortcut to also tray menu

This commit is contained in:
Jaex 2018-12-17 16:52:59 +03:00
parent eaf455bf3a
commit 37fae02e3a
5 changed files with 624 additions and 438 deletions

View file

@ -61,6 +61,12 @@ private void InitializeComponent()
this.tssCapture1 = new System.Windows.Forms.ToolStripSeparator(); this.tssCapture1 = new System.Windows.Forms.ToolStripSeparator();
this.tsmiShowCursor = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiShowCursor = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiScreenshotDelay = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay0 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay1 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay2 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay3 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay4 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay5 = new System.Windows.Forms.ToolStripMenuItem();
this.tsddbUpload = new System.Windows.Forms.ToolStripDropDownButton(); this.tsddbUpload = new System.Windows.Forms.ToolStripDropDownButton();
this.tsmiUploadFile = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiUploadFile = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiUploadFolder = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiUploadFolder = new System.Windows.Forms.ToolStripMenuItem();
@ -196,6 +202,7 @@ private void InitializeComponent()
this.tsmiTrayAutoCapture = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayAutoCapture = new System.Windows.Forms.ToolStripMenuItem();
this.tssTrayCapture1 = new System.Windows.Forms.ToolStripSeparator(); this.tssTrayCapture1 = new System.Windows.Forms.ToolStripSeparator();
this.tsmiTrayShowCursor = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayShowCursor = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayScreenshotDelay = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayUpload = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayUpload = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayUploadFile = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayUploadFile = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayUploadFolder = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayUploadFolder = new System.Windows.Forms.ToolStripMenuItem();
@ -263,12 +270,12 @@ private void InitializeComponent()
this.ucNews = new ShareX.NewsListControl(); this.ucNews = new ShareX.NewsListControl();
this.flpCommunity = new System.Windows.Forms.FlowLayoutPanel(); this.flpCommunity = new System.Windows.Forms.FlowLayoutPanel();
this.flpDiscord = new System.Windows.Forms.FlowLayoutPanel(); this.flpDiscord = new System.Windows.Forms.FlowLayoutPanel();
this.tsmiScreenshotDelay5 = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayScreenshotDelay0 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay4 = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayScreenshotDelay1 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay3 = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayScreenshotDelay2 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay2 = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayScreenshotDelay3 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay1 = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayScreenshotDelay4 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiScreenshotDelay0 = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTrayScreenshotDelay5 = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
this.scMain.Panel1.SuspendLayout(); this.scMain.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout(); this.scMain.Panel2.SuspendLayout();
@ -562,9 +569,44 @@ private void InitializeComponent()
this.tsmiScreenshotDelay3, this.tsmiScreenshotDelay3,
this.tsmiScreenshotDelay4, this.tsmiScreenshotDelay4,
this.tsmiScreenshotDelay5}); this.tsmiScreenshotDelay5});
this.tsmiScreenshotDelay.Image = global::ShareX.Properties.Resources.clock_select;
this.tsmiScreenshotDelay.Name = "tsmiScreenshotDelay";
resources.ApplyResources(this.tsmiScreenshotDelay, "tsmiScreenshotDelay"); resources.ApplyResources(this.tsmiScreenshotDelay, "tsmiScreenshotDelay");
this.tsmiScreenshotDelay.Name = "tsmiScreenshotDelay";
//
// tsmiScreenshotDelay0
//
this.tsmiScreenshotDelay0.Name = "tsmiScreenshotDelay0";
resources.ApplyResources(this.tsmiScreenshotDelay0, "tsmiScreenshotDelay0");
this.tsmiScreenshotDelay0.Click += new System.EventHandler(this.tsmiScreenshotDelay0_Click);
//
// tsmiScreenshotDelay1
//
this.tsmiScreenshotDelay1.Name = "tsmiScreenshotDelay1";
resources.ApplyResources(this.tsmiScreenshotDelay1, "tsmiScreenshotDelay1");
this.tsmiScreenshotDelay1.Click += new System.EventHandler(this.tsmiScreenshotDelay1_Click);
//
// tsmiScreenshotDelay2
//
this.tsmiScreenshotDelay2.Name = "tsmiScreenshotDelay2";
resources.ApplyResources(this.tsmiScreenshotDelay2, "tsmiScreenshotDelay2");
this.tsmiScreenshotDelay2.Click += new System.EventHandler(this.tsmiScreenshotDelay2_Click);
//
// tsmiScreenshotDelay3
//
this.tsmiScreenshotDelay3.Name = "tsmiScreenshotDelay3";
resources.ApplyResources(this.tsmiScreenshotDelay3, "tsmiScreenshotDelay3");
this.tsmiScreenshotDelay3.Click += new System.EventHandler(this.tsmiScreenshotDelay3_Click);
//
// tsmiScreenshotDelay4
//
this.tsmiScreenshotDelay4.Name = "tsmiScreenshotDelay4";
resources.ApplyResources(this.tsmiScreenshotDelay4, "tsmiScreenshotDelay4");
this.tsmiScreenshotDelay4.Click += new System.EventHandler(this.tsmiScreenshotDelay4_Click);
//
// tsmiScreenshotDelay5
//
this.tsmiScreenshotDelay5.Name = "tsmiScreenshotDelay5";
resources.ApplyResources(this.tsmiScreenshotDelay5, "tsmiScreenshotDelay5");
this.tsmiScreenshotDelay5.Click += new System.EventHandler(this.tsmiScreenshotDelay5_Click);
// //
// tsddbUpload // tsddbUpload
// //
@ -1493,7 +1535,8 @@ private void InitializeComponent()
this.tsmiTrayTextCapture, this.tsmiTrayTextCapture,
this.tsmiTrayAutoCapture, this.tsmiTrayAutoCapture,
this.tssTrayCapture1, this.tssTrayCapture1,
this.tsmiTrayShowCursor}); this.tsmiTrayShowCursor,
this.tsmiTrayScreenshotDelay});
this.tsmiTrayCapture.Image = global::ShareX.Properties.Resources.camera; this.tsmiTrayCapture.Image = global::ShareX.Properties.Resources.camera;
this.tsmiTrayCapture.Name = "tsmiTrayCapture"; this.tsmiTrayCapture.Name = "tsmiTrayCapture";
resources.ApplyResources(this.tsmiTrayCapture, "tsmiTrayCapture"); resources.ApplyResources(this.tsmiTrayCapture, "tsmiTrayCapture");
@ -1594,6 +1637,18 @@ private void InitializeComponent()
resources.ApplyResources(this.tsmiTrayShowCursor, "tsmiTrayShowCursor"); resources.ApplyResources(this.tsmiTrayShowCursor, "tsmiTrayShowCursor");
this.tsmiTrayShowCursor.Click += new System.EventHandler(this.tsmiShowCursor_Click); this.tsmiTrayShowCursor.Click += new System.EventHandler(this.tsmiShowCursor_Click);
// //
// tsmiTrayScreenshotDelay
//
this.tsmiTrayScreenshotDelay.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiTrayScreenshotDelay0,
this.tsmiTrayScreenshotDelay1,
this.tsmiTrayScreenshotDelay2,
this.tsmiTrayScreenshotDelay3,
this.tsmiTrayScreenshotDelay4,
this.tsmiTrayScreenshotDelay5});
resources.ApplyResources(this.tsmiTrayScreenshotDelay, "tsmiTrayScreenshotDelay");
this.tsmiTrayScreenshotDelay.Name = "tsmiTrayScreenshotDelay";
//
// tsmiTrayUpload // tsmiTrayUpload
// //
this.tsmiTrayUpload.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsmiTrayUpload.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -2085,41 +2140,41 @@ private void InitializeComponent()
this.flpDiscord.Controls.Add(this.pbDiscordHide); this.flpDiscord.Controls.Add(this.pbDiscordHide);
this.flpDiscord.Name = "flpDiscord"; this.flpDiscord.Name = "flpDiscord";
// //
// tsmiScreenshotDelay5 // tsmiTrayScreenshotDelay0
// //
this.tsmiScreenshotDelay5.Name = "tsmiScreenshotDelay5"; this.tsmiTrayScreenshotDelay0.Name = "tsmiTrayScreenshotDelay0";
resources.ApplyResources(this.tsmiScreenshotDelay5, "tsmiScreenshotDelay5"); resources.ApplyResources(this.tsmiTrayScreenshotDelay0, "tsmiTrayScreenshotDelay0");
this.tsmiScreenshotDelay5.Click += new System.EventHandler(this.tsmiScreenshotDelay5_Click); this.tsmiTrayScreenshotDelay0.Click += new System.EventHandler(this.tsmiScreenshotDelay0_Click);
// //
// tsmiScreenshotDelay4 // tsmiTrayScreenshotDelay1
// //
this.tsmiScreenshotDelay4.Name = "tsmiScreenshotDelay4"; this.tsmiTrayScreenshotDelay1.Name = "tsmiTrayScreenshotDelay1";
resources.ApplyResources(this.tsmiScreenshotDelay4, "tsmiScreenshotDelay4"); resources.ApplyResources(this.tsmiTrayScreenshotDelay1, "tsmiTrayScreenshotDelay1");
this.tsmiScreenshotDelay4.Click += new System.EventHandler(this.tsmiScreenshotDelay4_Click); this.tsmiTrayScreenshotDelay1.Click += new System.EventHandler(this.tsmiScreenshotDelay1_Click);
// //
// tsmiScreenshotDelay3 // tsmiTrayScreenshotDelay2
// //
this.tsmiScreenshotDelay3.Name = "tsmiScreenshotDelay3"; this.tsmiTrayScreenshotDelay2.Name = "tsmiTrayScreenshotDelay2";
resources.ApplyResources(this.tsmiScreenshotDelay3, "tsmiScreenshotDelay3"); resources.ApplyResources(this.tsmiTrayScreenshotDelay2, "tsmiTrayScreenshotDelay2");
this.tsmiScreenshotDelay3.Click += new System.EventHandler(this.tsmiScreenshotDelay3_Click); this.tsmiTrayScreenshotDelay2.Click += new System.EventHandler(this.tsmiScreenshotDelay2_Click);
// //
// tsmiScreenshotDelay2 // tsmiTrayScreenshotDelay3
// //
this.tsmiScreenshotDelay2.Name = "tsmiScreenshotDelay2"; this.tsmiTrayScreenshotDelay3.Name = "tsmiTrayScreenshotDelay3";
resources.ApplyResources(this.tsmiScreenshotDelay2, "tsmiScreenshotDelay2"); resources.ApplyResources(this.tsmiTrayScreenshotDelay3, "tsmiTrayScreenshotDelay3");
this.tsmiScreenshotDelay2.Click += new System.EventHandler(this.tsmiScreenshotDelay2_Click); this.tsmiTrayScreenshotDelay3.Click += new System.EventHandler(this.tsmiScreenshotDelay3_Click);
// //
// tsmiScreenshotDelay1 // tsmiTrayScreenshotDelay4
// //
this.tsmiScreenshotDelay1.Name = "tsmiScreenshotDelay1"; this.tsmiTrayScreenshotDelay4.Name = "tsmiTrayScreenshotDelay4";
resources.ApplyResources(this.tsmiScreenshotDelay1, "tsmiScreenshotDelay1"); resources.ApplyResources(this.tsmiTrayScreenshotDelay4, "tsmiTrayScreenshotDelay4");
this.tsmiScreenshotDelay1.Click += new System.EventHandler(this.tsmiScreenshotDelay1_Click); this.tsmiTrayScreenshotDelay4.Click += new System.EventHandler(this.tsmiScreenshotDelay4_Click);
// //
// tsmiScreenshotDelay0 // tsmiTrayScreenshotDelay5
// //
this.tsmiScreenshotDelay0.Name = "tsmiScreenshotDelay0"; this.tsmiTrayScreenshotDelay5.Name = "tsmiTrayScreenshotDelay5";
resources.ApplyResources(this.tsmiScreenshotDelay0, "tsmiScreenshotDelay0"); resources.ApplyResources(this.tsmiTrayScreenshotDelay5, "tsmiTrayScreenshotDelay5");
this.tsmiScreenshotDelay0.Click += new System.EventHandler(this.tsmiScreenshotDelay0_Click); this.tsmiTrayScreenshotDelay5.Click += new System.EventHandler(this.tsmiScreenshotDelay5_Click);
// //
// MainForm // MainForm
// //
@ -2407,5 +2462,12 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem tsmiScreenshotDelay3; private System.Windows.Forms.ToolStripMenuItem tsmiScreenshotDelay3;
private System.Windows.Forms.ToolStripMenuItem tsmiScreenshotDelay4; private System.Windows.Forms.ToolStripMenuItem tsmiScreenshotDelay4;
private System.Windows.Forms.ToolStripMenuItem tsmiScreenshotDelay5; private System.Windows.Forms.ToolStripMenuItem tsmiScreenshotDelay5;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayScreenshotDelay;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayScreenshotDelay0;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayScreenshotDelay1;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayScreenshotDelay2;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayScreenshotDelay3;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayScreenshotDelay4;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayScreenshotDelay5;
} }
} }

View file

@ -174,7 +174,8 @@ private void InitializeControls()
{ {
tsddbAfterCaptureTasks, tsddbAfterUploadTasks, tsmiImageUploaders, tsmiImageFileUploaders, tsmiTextUploaders, tsmiTextFileUploaders, tsmiFileUploaders, tsddbAfterCaptureTasks, tsddbAfterUploadTasks, tsmiImageUploaders, tsmiImageFileUploaders, tsmiTextUploaders, tsmiTextFileUploaders, tsmiFileUploaders,
tsmiURLShorteners, tsmiURLSharingServices, tsmiTrayAfterCaptureTasks, tsmiTrayAfterUploadTasks, tsmiTrayImageUploaders, tsmiTrayImageFileUploaders, tsmiURLShorteners, tsmiURLSharingServices, tsmiTrayAfterCaptureTasks, tsmiTrayAfterUploadTasks, tsmiTrayImageUploaders, tsmiTrayImageFileUploaders,
tsmiTrayTextUploaders, tsmiTrayTextFileUploaders, tsmiTrayFileUploaders, tsmiTrayURLShorteners, tsmiTrayURLSharingServices, tsmiScreenshotDelay tsmiTrayTextUploaders, tsmiTrayTextFileUploaders, tsmiTrayFileUploaders, tsmiTrayURLShorteners, tsmiTrayURLSharingServices, tsmiScreenshotDelay,
tsmiTrayScreenshotDelay
}) })
{ {
dropDownItem.DisableMenuCloseOnClick(); dropDownItem.DisableMenuCloseOnClick();
@ -1036,29 +1037,36 @@ private void SetScreenshotDelay(decimal delay)
{ {
default: default:
tsmiScreenshotDelay.UpdateCheckedAll(false); tsmiScreenshotDelay.UpdateCheckedAll(false);
tsmiTrayScreenshotDelay.UpdateCheckedAll(false);
break; break;
case 0: case 0:
tsmiScreenshotDelay0.RadioCheck(); tsmiScreenshotDelay0.RadioCheck();
tsmiTrayScreenshotDelay0.RadioCheck();
break; break;
case 1: case 1:
tsmiScreenshotDelay1.RadioCheck(); tsmiScreenshotDelay1.RadioCheck();
tsmiTrayScreenshotDelay1.RadioCheck();
break; break;
case 2: case 2:
tsmiScreenshotDelay2.RadioCheck(); tsmiScreenshotDelay2.RadioCheck();
tsmiTrayScreenshotDelay2.RadioCheck();
break; break;
case 3: case 3:
tsmiScreenshotDelay3.RadioCheck(); tsmiScreenshotDelay3.RadioCheck();
tsmiTrayScreenshotDelay3.RadioCheck();
break; break;
case 4: case 4:
tsmiScreenshotDelay4.RadioCheck(); tsmiScreenshotDelay4.RadioCheck();
tsmiTrayScreenshotDelay4.RadioCheck();
break; break;
case 5: case 5:
tsmiScreenshotDelay5.RadioCheck(); tsmiScreenshotDelay5.RadioCheck();
tsmiTrayScreenshotDelay5.RadioCheck();
break; break;
} }
tsmiScreenshotDelay.Text = string.Format("Screenshot delay: {0}s", (int)delay); tsmiScreenshotDelay.Text = tsmiTrayScreenshotDelay.Text = string.Format("Screenshot delay: {0}s", (int)delay);
tsmiScreenshotDelay.Checked = delay > 0; tsmiScreenshotDelay.Checked = tsmiTrayScreenshotDelay.Checked = delay > 0;
} }
private async Task PrepareCaptureMenuAsync(ToolStripMenuItem tsmiWindow, EventHandler handlerWindow, ToolStripMenuItem tsmiMonitor, EventHandler handlerMonitor) private async Task PrepareCaptureMenuAsync(ToolStripMenuItem tsmiWindow, EventHandler handlerWindow, ToolStripMenuItem tsmiMonitor, EventHandler handlerMonitor)

File diff suppressed because it is too large Load diff

View file

@ -891,7 +891,7 @@ public class Resources {
/// </summary> /// </summary>
public static System.Drawing.Bitmap clock_select { public static System.Drawing.Bitmap clock_select {
get { get {
object obj = ResourceManager.GetObject("clock-select", resourceCulture); object obj = ResourceManager.GetObject("clock_select", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }

View file

@ -991,7 +991,7 @@ Middle click to close</value>
<data name="application_home" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="application_home" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\application-home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\application-home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="clock-select" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="clock_select" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\clock-select.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\clock-select.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
</root> </root>