From c5fa3aab69b71f16b158de13d5be1f00f7f39936 Mon Sep 17 00:00:00 2001 From: Jaex Date: Tue, 6 Jun 2017 17:05:15 +0300 Subject: [PATCH] News button toggles news panel --- ShareX/Forms/MainForm.Designer.cs | 54 ++-- ShareX/Forms/MainForm.cs | 9 +- ShareX/Forms/MainForm.resx | 520 ++++++++++++++++-------------- 3 files changed, 309 insertions(+), 274 deletions(-) diff --git a/ShareX/Forms/MainForm.Designer.cs b/ShareX/Forms/MainForm.Designer.cs index dae03c2ba..58275777b 100644 --- a/ShareX/Forms/MainForm.Designer.cs +++ b/ShareX/Forms/MainForm.Designer.cs @@ -106,9 +106,8 @@ private void InitializeComponent() this.tsmiTestFileUpload = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTestURLShortener = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTestURLSharing = new System.Windows.Forms.ToolStripMenuItem(); - this.tsbNews = new ShareX.HelpersLib.ToolStripButtonExtraImage(); - this.tsmiDonate = new ShareX.HelpersLib.ToolStripButtonColorAnimation(); - this.tsmiAbout = new System.Windows.Forms.ToolStripButton(); + this.tsbDonate = new ShareX.HelpersLib.ToolStripButtonColorAnimation(); + this.tsbAbout = new System.Windows.Forms.ToolStripButton(); this.cmsTaskInfo = new System.Windows.Forms.ContextMenuStrip(this.components); this.tsmiShowErrors = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiStopUpload = new System.Windows.Forms.ToolStripMenuItem(); @@ -240,6 +239,7 @@ private void InitializeComponent() this.timerTraySingleClick = new System.Windows.Forms.Timer(this.components); this.ttMain = new System.Windows.Forms.ToolTip(this.components); this.ucNews = new ShareX.NewsListControl(); + this.tsbNews = new ShareX.HelpersLib.ToolStripButtonColorAnimation(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); this.scMain.Panel1.SuspendLayout(); this.scMain.Panel2.SuspendLayout(); @@ -394,8 +394,8 @@ private void InitializeComponent() this.tsbImageHistory, this.tsddbDebug, this.tsbNews, - this.tsmiDonate, - this.tsmiAbout}); + this.tsbDonate, + this.tsbAbout}); this.tsMain.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.VerticalStackWithOverflow; this.tsMain.Name = "tsMain"; this.tsMain.ShowItemToolTips = false; @@ -861,28 +861,20 @@ private void InitializeComponent() resources.ApplyResources(this.tsmiTestURLSharing, "tsmiTestURLSharing"); this.tsmiTestURLSharing.Click += new System.EventHandler(this.tsmiTestURLSharing_Click); // - // tsbNews + // tsbDonate // - this.tsbNews.ExtraImage = global::ShareX.Properties.Resources.Exclamation_16; - this.tsbNews.Image = global::ShareX.Properties.Resources.megaphone; - resources.ApplyResources(this.tsbNews, "tsbNews"); - this.tsbNews.Name = "tsbNews"; - this.tsbNews.ShowExtraImage = true; + this.tsbDonate.AnimationSpeed = 0.8F; + this.tsbDonate.Image = global::ShareX.Properties.Resources.heart; + resources.ApplyResources(this.tsbDonate, "tsbDonate"); + this.tsbDonate.Name = "tsbDonate"; + this.tsbDonate.Click += new System.EventHandler(this.tsbDonate_Click); // - // tsmiDonate + // tsbAbout // - this.tsmiDonate.AnimationSpeed = 0.8F; - this.tsmiDonate.Image = global::ShareX.Properties.Resources.heart; - resources.ApplyResources(this.tsmiDonate, "tsmiDonate"); - this.tsmiDonate.Name = "tsmiDonate"; - this.tsmiDonate.Click += new System.EventHandler(this.tsbDonate_Click); - // - // tsmiAbout - // - this.tsmiAbout.Image = global::ShareX.Properties.Resources.crown; - resources.ApplyResources(this.tsmiAbout, "tsmiAbout"); - this.tsmiAbout.Name = "tsmiAbout"; - this.tsmiAbout.Click += new System.EventHandler(this.tsbAbout_Click); + this.tsbAbout.Image = global::ShareX.Properties.Resources.crown; + resources.ApplyResources(this.tsbAbout, "tsbAbout"); + this.tsbAbout.Name = "tsbAbout"; + this.tsbAbout.Click += new System.EventHandler(this.tsbAbout_Click); // // cmsTaskInfo // @@ -1864,6 +1856,14 @@ private void InitializeComponent() resources.ApplyResources(this.ucNews, "ucNews"); this.ucNews.Name = "ucNews"; // + // tsbNews + // + this.tsbNews.CheckOnClick = true; + this.tsbNews.Image = global::ShareX.Properties.Resources.megaphone; + resources.ApplyResources(this.tsbNews, "tsbNews"); + this.tsbNews.Name = "tsbNews"; + this.tsbNews.Click += new System.EventHandler(this.tsbNews_Click); + // // MainForm // this.AllowDrop = true; @@ -2024,8 +2024,8 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem tsmiTrayIndexFolder; private System.Windows.Forms.ToolStripMenuItem tsmiImageEffects; private System.Windows.Forms.ToolStripMenuItem tsmiTrayImageEffects; - private System.Windows.Forms.ToolStripButton tsmiAbout; - private ShareX.HelpersLib.ToolStripButtonColorAnimation tsmiDonate; + private System.Windows.Forms.ToolStripButton tsbAbout; + private ShareX.HelpersLib.ToolStripButtonColorAnimation tsbDonate; private System.Windows.Forms.ToolStripMenuItem tsmiMonitorTest; private System.Windows.Forms.ToolStripMenuItem tsmiTrayMonitorTest; private System.Windows.Forms.ToolStripMenuItem tsmiTrayShow; @@ -2112,7 +2112,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem tsmiOpenActionsToolbar; private System.Windows.Forms.ToolStripMenuItem tsmiDeleteSelectedItem; private System.Windows.Forms.ToolStripMenuItem tsmiSearchImage; - private ShareX.HelpersLib.ToolStripButtonExtraImage tsbNews; private NewsListControl ucNews; + private HelpersLib.ToolStripButtonColorAnimation tsbNews; } } \ No newline at end of file diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index a088ceece..57c4c229b 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -1024,11 +1024,11 @@ private void MainForm_VisibleChanged(object sender, EventArgs e) #if !DEBUG if (Visible) { - tsmiDonate.StartAnimation(); + tsbDonate.StartAnimation(); } else { - tsmiDonate.StopAnimation(); + tsbDonate.StopAnimation(); } #endif } @@ -1544,6 +1544,11 @@ private void tsmiTestURLSharing_Click(object sender, EventArgs e) UploadManager.ShareURL(Links.URL_WEBSITE); } + private void tsbNews_Click(object sender, EventArgs e) + { + ucNews.Visible = !ucNews.Visible; + } + private void tsbDonate_Click(object sender, EventArgs e) { URLHelpers.OpenURL(Links.URL_DONATE); diff --git a/ShareX/Forms/MainForm.resx b/ShareX/Forms/MainForm.resx index 8d19eb2fb..eeb9e9ae9 100644 --- a/ShareX/Forms/MainForm.resx +++ b/ShareX/Forms/MainForm.resx @@ -159,45 +159,6 @@ 0 - - Filename - - - 150 - - - Status - - - Progress - - - 125 - - - Speed - - - 75 - - - Elapsed - - - 45 - - - Remaining - - - 45 - - - URL - - - 145 - Fill @@ -294,12 +255,105 @@ 4 + + Filename + + + 150 + + + Status + + + Progress + + + 125 + + + Speed + + + 75 + + + Elapsed + + + 45 + + + Remaining + + + 45 + + + URL + + + 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 @@ -315,9 +369,6 @@ 0 - - 567, 17 - Open ShareX Patreon campaign web page @@ -363,33 +414,6 @@ 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 - 17, 17 @@ -399,6 +423,42 @@ Left + + 0, 0 + + + 6, 6, 6, 6 + + + 160, 429 + + + 1 + + + tsMain + + + ShareX.HelpersLib.ToolStripBorderRight, ShareX.HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 5 + + + MiddleLeft + + + Magenta + + + 147, 20 + + + Capture + 191, 22 @@ -477,17 +537,17 @@ Auto capture... - + MiddleLeft - + Magenta - + 147, 20 - - Capture + + Upload 203, 22 @@ -519,18 +579,6 @@ Drag and drop upload... - - MiddleLeft - - - Magenta - - - 147, 20 - - - Upload - BottomLeft @@ -543,6 +591,18 @@ Workflows + + MiddleLeft + + + Magenta + + + 147, 20 + + + Tools + 183, 22 @@ -627,18 +687,6 @@ Monitor test... - - MiddleLeft - - - Magenta - - - 147, 20 - - - Tools - 147, 6 @@ -666,6 +714,18 @@ After upload tasks + + MiddleLeft + + + Magenta + + + 147, 20 + + + Destinations + 187, 22 @@ -705,18 +765,6 @@ Destination settings... - - MiddleLeft - - - Magenta - - - 147, 20 - - - Destinations - MiddleLeft @@ -792,6 +840,18 @@ Image history... + + MiddleLeft + + + Magenta + + + 147, 20 + + + Debug + 172, 22 @@ -828,81 +888,42 @@ Test URL sharing - + MiddleLeft - + Magenta - + 147, 20 - - Debug - - - MiddleLeft - - - Magenta - - - 147, 20 - - - News - - - MiddleLeft - - - Magenta - - - 147, 20 - - + Donate... - + MiddleLeft - + Magenta - + 147, 20 - + About... - - 0, 0 - - - 6, 6, 6, 6 - - - 160, 429 - - - 1 - - - tsMain - - - ShareX.HelpersLib.ToolStripBorderRight, ShareX.HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 5 - 286, 17 + + 229, 450 + + + cmsTaskInfo + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 228, 22 @@ -915,6 +936,15 @@ Stop upload + + + + + 228, 22 + + + Open + Enter @@ -969,14 +999,14 @@ Thumbnail file - + - + 228, 22 - - Open + + Copy Ctrl+C @@ -1122,15 +1152,6 @@ False - - - - - 228, 22 - - - Copy - Ctrl+U @@ -1239,6 +1260,12 @@ Hide columns + + 228, 22 + + + Image preview + 130, 22 @@ -1257,27 +1284,30 @@ Automatic - - 228, 22 - - - Image preview - - - 229, 450 - - - cmsTaskInfo - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 105, 17 190, 17 + + 193, 484 + + + cmsTray + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShareX + + + 192, 22 + + + Capture + 191, 22 @@ -1356,11 +1386,11 @@ Auto capture... - + 192, 22 - - Capture + + Upload 203, 22 @@ -1392,18 +1422,18 @@ Drag and drop upload... - - 192, 22 - - - Upload - 192, 22 Workflows + + 192, 22 + + + Tools + 183, 22 @@ -1488,12 +1518,6 @@ Monitor test... - - 192, 22 - - - Tools - 189, 6 @@ -1509,6 +1533,12 @@ After upload tasks + + 192, 22 + + + Destinations + 187, 22 @@ -1548,12 +1578,6 @@ Destination settings... - - 192, 22 - - - Destinations - 192, 22 @@ -1599,6 +1623,12 @@ Image history... + + 192, 22 + + + Debug + 172, 22 @@ -1635,12 +1665,6 @@ Test URL sharing - - 192, 22 - - - Debug - 192, 22 @@ -1683,21 +1707,12 @@ Exit - - 193, 484 - - - cmsTray - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ShareX - 405, 17 + + 567, 17 + Fill @@ -1713,6 +1728,9 @@ 4 + + False + ucNews @@ -1725,6 +1743,18 @@ 2 + + MiddleLeft + + + Magenta + + + 147, 20 + + + News + True @@ -2151,22 +2181,16 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tsbNews + + tsbDonate - - ShareX.HelpersLib.ToolStripButtonExtraImage, ShareX.HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - tsmiDonate - - + ShareX.HelpersLib.ToolStripButtonColorAnimation, ShareX.HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - tsmiAbout + + tsbAbout - + System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -2937,6 +2961,12 @@ System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tsbNews + + + ShareX.HelpersLib.ToolStripButtonColorAnimation, ShareX.HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + MainForm