diff --git a/ShareX.HelpersLib/Links.cs b/ShareX.HelpersLib/Links.cs index 1c158edec..74ff4548e 100644 --- a/ShareX.HelpersLib/Links.cs +++ b/ShareX.HelpersLib/Links.cs @@ -37,6 +37,7 @@ public static class Links public const string URL_MIKE = "https://github.com/McoreD"; public const string URL_STEAM = "http://store.steampowered.com/app/400040/"; public const string URL_PATREON = "https://www.patreon.com/ShareX"; + public const string URL_DISCORD = "https://discord.gg/E4R3Qa9"; private const string URL_DOCS = URL_WEBSITE + "/docs"; public const string URL_CUSTOM_UPLOADER = URL_DOCS + "/custom-uploader"; public const string URL_CUSTOM_UPLOADERS = "https://github.com/ShareX/CustomUploaders"; diff --git a/ShareX/ApplicationConfig.cs b/ShareX/ApplicationConfig.cs index bcb4bc617..db021a93b 100644 --- a/ShareX/ApplicationConfig.cs +++ b/ShareX/ApplicationConfig.cs @@ -45,7 +45,8 @@ public class ApplicationConfig : SettingsBase public int NameParserAutoIncrementNumber = 0; public bool DisableHotkeys = false; public List QuickTaskPresets = QuickTaskInfo.DefaultPresets; - public bool ShowPatreonButton = true; + public bool ShowPatreonButton { get; set; } = true; + public bool ShowDiscordButton { get; set; } = true; public ApplicationConfig() { diff --git a/ShareX/Forms/MainForm.Designer.cs b/ShareX/Forms/MainForm.Designer.cs index 7e20c3c6d..04ef1331c 100644 --- a/ShareX/Forms/MainForm.Designer.cs +++ b/ShareX/Forms/MainForm.Designer.cs @@ -144,11 +144,15 @@ private void InitializeComponent() this.tsmiCopyForumImage = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiCopyForumLinkedImage = new System.Windows.Forms.ToolStripMenuItem(); this.tssCopy4 = new System.Windows.Forms.ToolStripSeparator(); + this.tsmiCopyMarkdownLink = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmiCopyMarkdownImage = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmiCopyMarkdownLinkedImage = new System.Windows.Forms.ToolStripMenuItem(); + this.tssCopy5 = new System.Windows.Forms.ToolStripSeparator(); this.tsmiCopyFilePath = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiCopyFileName = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiCopyFileNameWithExtension = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiCopyFolder = new System.Windows.Forms.ToolStripMenuItem(); - this.tssCopy5 = new System.Windows.Forms.ToolStripSeparator(); + this.tssCopy6 = new System.Windows.Forms.ToolStripSeparator(); this.tsmiUploadSelectedFile = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiDownloadSelectedURL = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiEditSelectedFile = new System.Windows.Forms.ToolStripMenuItem(); @@ -245,13 +249,13 @@ private void InitializeComponent() this.tsmiTrayExit = new System.Windows.Forms.ToolStripMenuItem(); this.timerTraySingleClick = new System.Windows.Forms.Timer(this.components); this.ttMain = new System.Windows.Forms.ToolTip(this.components); + this.pbDiscordOpen = new System.Windows.Forms.PictureBox(); + this.pbDiscordHide = new System.Windows.Forms.PictureBox(); this.ucNews = new ShareX.NewsListControl(); this.pNews = new System.Windows.Forms.Panel(); this.btnCloseNews = new System.Windows.Forms.Button(); - this.tsmiCopyMarkdownLink = new System.Windows.Forms.ToolStripMenuItem(); - this.tsmiCopyMarkdownImage = new System.Windows.Forms.ToolStripMenuItem(); - this.tsmiCopyMarkdownLinkedImage = new System.Windows.Forms.ToolStripMenuItem(); - this.tssCopy6 = new System.Windows.Forms.ToolStripSeparator(); + this.flpCommunity = new System.Windows.Forms.FlowLayoutPanel(); + this.flpDiscord = new System.Windows.Forms.FlowLayoutPanel(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); this.scMain.Panel1.SuspendLayout(); this.scMain.Panel2.SuspendLayout(); @@ -262,7 +266,11 @@ private void InitializeComponent() this.tsMain.SuspendLayout(); this.cmsTaskInfo.SuspendLayout(); this.cmsTray.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbDiscordOpen)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbDiscordHide)).BeginInit(); this.pNews.SuspendLayout(); + this.flpCommunity.SuspendLayout(); + this.flpDiscord.SuspendLayout(); this.SuspendLayout(); // // scMain @@ -1171,6 +1179,29 @@ private void InitializeComponent() this.tssCopy4.Name = "tssCopy4"; resources.ApplyResources(this.tssCopy4, "tssCopy4"); // + // tsmiCopyMarkdownLink + // + this.tsmiCopyMarkdownLink.Name = "tsmiCopyMarkdownLink"; + resources.ApplyResources(this.tsmiCopyMarkdownLink, "tsmiCopyMarkdownLink"); + this.tsmiCopyMarkdownLink.Click += new System.EventHandler(this.tsmiCopyMarkdownLink_Click); + // + // tsmiCopyMarkdownImage + // + this.tsmiCopyMarkdownImage.Name = "tsmiCopyMarkdownImage"; + resources.ApplyResources(this.tsmiCopyMarkdownImage, "tsmiCopyMarkdownImage"); + this.tsmiCopyMarkdownImage.Click += new System.EventHandler(this.tsmiCopyMarkdownImage_Click); + // + // tsmiCopyMarkdownLinkedImage + // + this.tsmiCopyMarkdownLinkedImage.Name = "tsmiCopyMarkdownLinkedImage"; + resources.ApplyResources(this.tsmiCopyMarkdownLinkedImage, "tsmiCopyMarkdownLinkedImage"); + this.tsmiCopyMarkdownLinkedImage.Click += new System.EventHandler(this.tsmiCopyMarkdownLinkedImage_Click); + // + // tssCopy5 + // + this.tssCopy5.Name = "tssCopy5"; + resources.ApplyResources(this.tssCopy5, "tssCopy5"); + // // tsmiCopyFilePath // this.tsmiCopyFilePath.Name = "tsmiCopyFilePath"; @@ -1195,10 +1226,10 @@ private void InitializeComponent() resources.ApplyResources(this.tsmiCopyFolder, "tsmiCopyFolder"); this.tsmiCopyFolder.Click += new System.EventHandler(this.tsmiCopyFolder_Click); // - // tssCopy5 + // tssCopy6 // - this.tssCopy5.Name = "tssCopy5"; - resources.ApplyResources(this.tssCopy5, "tssCopy5"); + this.tssCopy6.Name = "tssCopy6"; + resources.ApplyResources(this.tssCopy6, "tssCopy6"); // // tsmiUploadSelectedFile // @@ -1924,6 +1955,26 @@ private void InitializeComponent() this.ttMain.InitialDelay = 200; this.ttMain.ReshowDelay = 100; // + // pbDiscordOpen + // + this.pbDiscordOpen.Cursor = System.Windows.Forms.Cursors.Hand; + this.pbDiscordOpen.Image = global::ShareX.Properties.Resources.Discord_Button_01; + resources.ApplyResources(this.pbDiscordOpen, "pbDiscordOpen"); + this.pbDiscordOpen.Name = "pbDiscordOpen"; + this.pbDiscordOpen.TabStop = false; + this.ttMain.SetToolTip(this.pbDiscordOpen, resources.GetString("pbDiscordOpen.ToolTip")); + this.pbDiscordOpen.Click += new System.EventHandler(this.pbDiscordOpen_Click); + // + // pbDiscordHide + // + this.pbDiscordHide.Cursor = System.Windows.Forms.Cursors.Hand; + this.pbDiscordHide.Image = global::ShareX.Properties.Resources.Discord_Button_02; + resources.ApplyResources(this.pbDiscordHide, "pbDiscordHide"); + this.pbDiscordHide.Name = "pbDiscordHide"; + this.pbDiscordHide.TabStop = false; + this.ttMain.SetToolTip(this.pbDiscordHide, resources.GetString("pbDiscordHide.ToolTip")); + this.pbDiscordHide.Click += new System.EventHandler(this.pbDiscordHide_Click); + // // ucNews // resources.ApplyResources(this.ucNews, "ucNews"); @@ -1943,28 +1994,20 @@ private void InitializeComponent() this.btnCloseNews.UseVisualStyleBackColor = true; this.btnCloseNews.Click += new System.EventHandler(this.btnCloseNews_Click); // - // tsmiCopyMarkdownLink + // flpCommunity // - this.tsmiCopyMarkdownLink.Name = "tsmiCopyMarkdownLink"; - resources.ApplyResources(this.tsmiCopyMarkdownLink, "tsmiCopyMarkdownLink"); - this.tsmiCopyMarkdownLink.Click += new System.EventHandler(this.tsmiCopyMarkdownLink_Click); + resources.ApplyResources(this.flpCommunity, "flpCommunity"); + this.flpCommunity.Controls.Add(this.flpPatreon); + this.flpCommunity.Controls.Add(this.flpDiscord); + this.flpCommunity.Name = "flpCommunity"; // - // tsmiCopyMarkdownImage + // flpDiscord // - this.tsmiCopyMarkdownImage.Name = "tsmiCopyMarkdownImage"; - resources.ApplyResources(this.tsmiCopyMarkdownImage, "tsmiCopyMarkdownImage"); - this.tsmiCopyMarkdownImage.Click += new System.EventHandler(this.tsmiCopyMarkdownImage_Click); - // - // tsmiCopyMarkdownLinkedImage - // - this.tsmiCopyMarkdownLinkedImage.Name = "tsmiCopyMarkdownLinkedImage"; - resources.ApplyResources(this.tsmiCopyMarkdownLinkedImage, "tsmiCopyMarkdownLinkedImage"); - this.tsmiCopyMarkdownLinkedImage.Click += new System.EventHandler(this.tsmiCopyMarkdownLinkedImage_Click); - // - // tssCopy6 - // - this.tssCopy6.Name = "tssCopy6"; - resources.ApplyResources(this.tssCopy6, "tssCopy6"); + resources.ApplyResources(this.flpDiscord, "flpDiscord"); + this.flpDiscord.BackColor = System.Drawing.Color.Transparent; + this.flpDiscord.Controls.Add(this.pbDiscordOpen); + this.flpDiscord.Controls.Add(this.pbDiscordHide); + this.flpDiscord.Name = "flpDiscord"; // // MainForm // @@ -1972,10 +2015,10 @@ private void InitializeComponent() resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.pNews); - this.Controls.Add(this.flpPatreon); + this.Controls.Add(this.flpCommunity); this.Controls.Add(this.scMain); this.Controls.Add(this.tsMain); + this.Controls.Add(this.pNews); this.DoubleBuffered = true; this.Name = "MainForm"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); @@ -1999,7 +2042,13 @@ private void InitializeComponent() this.tsMain.PerformLayout(); this.cmsTaskInfo.ResumeLayout(false); this.cmsTray.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pbDiscordOpen)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbDiscordHide)).EndInit(); this.pNews.ResumeLayout(false); + this.flpCommunity.ResumeLayout(false); + this.flpCommunity.PerformLayout(); + this.flpDiscord.ResumeLayout(false); + this.flpDiscord.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -2229,5 +2278,9 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem tsmiCopyMarkdownImage; private System.Windows.Forms.ToolStripMenuItem tsmiCopyMarkdownLinkedImage; private System.Windows.Forms.ToolStripSeparator tssCopy6; + private System.Windows.Forms.FlowLayoutPanel flpCommunity; + private System.Windows.Forms.FlowLayoutPanel flpDiscord; + private System.Windows.Forms.PictureBox pbDiscordOpen; + private System.Windows.Forms.PictureBox pbDiscordHide; } } \ No newline at end of file diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index d8a908fe5..713f78160 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -204,6 +204,7 @@ public void UpdateControls() niTray.Visible = Program.Settings.ShowTray; flpPatreon.Visible = Program.Settings.ShowPatreonButton; + flpDiscord.Visible = Program.Settings.ShowDiscordButton; TaskManager.RecentManager.InitItems(); @@ -1269,6 +1270,17 @@ private void lvUploads_QueryContinueDrag(object sender, QueryContinueDragEventAr } } + private void pbDiscordOpen_Click(object sender, EventArgs e) + { + URLHelpers.OpenURL(Links.URL_DISCORD); + } + + private void pbDiscordHide_Click(object sender, EventArgs e) + { + flpDiscord.Visible = false; + Program.Settings.ShowDiscordButton = false; + } + private void pbPatreonOpen_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_PATREON); diff --git a/ShareX/Forms/MainForm.resx b/ShareX/Forms/MainForm.resx index 95f17fde5..835c10462 100644 --- a/ShareX/Forms/MainForm.resx +++ b/ShareX/Forms/MainForm.resx @@ -253,7 +253,7 @@ $this - 4 + 3 Filename @@ -294,66 +294,9 @@ 145 - - Bottom, Right - True - - pbPatreonOpen - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flpPatreon - - - 0 - - - pbPatreonHide - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flpPatreon - - - 1 - - - 613, 378 - - - 215, 45 - - - 3 - - - False - - - False - - - flpPatreon - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - 567, 17 - 0, 0 @@ -369,6 +312,9 @@ 0 + + 567, 17 + Open ShareX Patreon campaign web page @@ -414,6 +360,33 @@ 1 + + 3, 54 + + + 215, 45 + + + 3 + + + False + + + False + + + flpPatreon + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flpCommunity + + + 0 + 17, 17 @@ -445,7 +418,7 @@ $this - 5 + 4 MiddleLeft @@ -945,6 +918,15 @@ 286, 17 + + 229, 450 + + + cmsTaskInfo + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 228, 22 @@ -963,6 +945,66 @@ Open + + Enter + + + 173, 22 + + + URL + + + 173, 22 + + + Shortened URL + + + 173, 22 + + + Thumbnail URL + + + 173, 22 + + + Deletion URL + + + 170, 6 + + + Ctrl+Enter + + + 173, 22 + + + File + + + Shift+Enter + + + 173, 22 + + + Folder + + + 173, 22 + + + Thumbnail file + + + 228, 22 + + + Copy + Ctrl+C @@ -1128,12 +1170,6 @@ False - - 228, 22 - - - Copy - Ctrl+U @@ -1248,69 +1284,6 @@ Image preview - - 229, 472 - - - cmsTaskInfo - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Enter - - - 173, 22 - - - URL - - - 173, 22 - - - Shortened URL - - - 173, 22 - - - Thumbnail URL - - - 173, 22 - - - Deletion URL - - - 170, 6 - - - Ctrl+Enter - - - 173, 22 - - - File - - - Shift+Enter - - - 173, 22 - - - Folder - - - 173, 22 - - - Thumbnail file - 130, 22 @@ -1773,9 +1746,72 @@ 405, 17 - - 567, 17 - + + NoControl + + + 0, 0 + + + 0, 0, 0, 0 + + + 168, 45 + + + AutoSize + + + 0 + + + Open ShareX Discord server invite link + + + pbDiscordOpen + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flpDiscord + + + 0 + + + NoControl + + + 168, 0 + + + 0, 0, 0, 0 + + + 47, 45 + + + AutoSize + + + 1 + + + Hide Discord button permanently + + + pbDiscordHide + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flpDiscord + + + 1 + Fill @@ -1786,7 +1822,7 @@ 0, 0, 0, 0 - 674, 429 + 834, 429 4 @@ -1819,10 +1855,10 @@ Fill - 160, 0 + 0, 0 - 674, 429 + 834, 429 5 @@ -1840,13 +1876,13 @@ $this - 2 + 5 Bottom, Right - 560, 400 + 720, 400 91, 23 @@ -1869,6 +1905,69 @@ 0 + + Bottom, Right + + + True + + + GrowAndShrink + + + True + + + 3, 3 + + + 215, 45 + + + 4 + + + False + + + False + + + flpDiscord + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flpCommunity + + + 1 + + + BottomUp + + + 608, 322 + + + 221, 102 + + + 6 + + + flpCommunity + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + True @@ -2517,6 +2616,30 @@ System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tsmiCopyMarkdownLink + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tsmiCopyMarkdownImage + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tsmiCopyMarkdownLinkedImage + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tssCopy5 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + tsmiCopyFilePath @@ -2541,10 +2664,10 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tssCopy5 + + tssCopy6 - + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -3117,30 +3240,6 @@ System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tsmiCopyMarkdownLink - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsmiCopyMarkdownImage - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsmiCopyMarkdownLinkedImage - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tssCopy6 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - MainForm diff --git a/ShareX/Properties/Resources.Designer.cs b/ShareX/Properties/Resources.Designer.cs index e304a6155..2373db89d 100644 --- a/ShareX/Properties/Resources.Designer.cs +++ b/ShareX/Properties/Resources.Designer.cs @@ -913,6 +913,26 @@ public static System.Drawing.Bitmap de { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap Discord_Button_01 { + get { + object obj = ResourceManager.GetObject("Discord_Button_01", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap Discord_Button_02 { + get { + object obj = ResourceManager.GetObject("Discord_Button_02", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShareX/Properties/Resources.resx b/ShareX/Properties/Resources.resx index 2584228cf..021e713c7 100644 --- a/ShareX/Properties/Resources.resx +++ b/ShareX/Properties/Resources.resx @@ -966,4 +966,10 @@ Middle click to close Run ShareX when Windows starts + + ..\Resources\Discord_Button_01.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Discord_Button_02.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/ShareX/Resources/Discord_Button_01.png b/ShareX/Resources/Discord_Button_01.png new file mode 100644 index 000000000..b53654015 Binary files /dev/null and b/ShareX/Resources/Discord_Button_01.png differ diff --git a/ShareX/Resources/Discord_Button_02.png b/ShareX/Resources/Discord_Button_02.png new file mode 100644 index 000000000..41141d18b Binary files /dev/null and b/ShareX/Resources/Discord_Button_02.png differ diff --git a/ShareX/ShareX.csproj b/ShareX/ShareX.csproj index d2bc1cacf..0dc7f8219 100644 --- a/ShareX/ShareX.csproj +++ b/ShareX/ShareX.csproj @@ -1498,6 +1498,8 @@ + +