From e509adae42d8582ca49d5f8696559def45193691 Mon Sep 17 00:00:00 2001 From: Jaex Date: Thu, 1 Jun 2017 14:33:32 +0300 Subject: [PATCH] Interim news commit --- ShareX/Controls/NewsListControl.Designer.cs | 65 +++ ShareX/Controls/NewsListControl.cs | 83 ++++ ShareX/Controls/NewsListControl.resx | 120 +++++ ShareX/Forms/MainForm.Designer.cs | 9 + ShareX/Forms/MainForm.resx | 482 +++++++++++--------- ShareX/NewsItem.cs | 39 ++ ShareX/ShareX.csproj | 10 + 7 files changed, 594 insertions(+), 214 deletions(-) create mode 100644 ShareX/Controls/NewsListControl.Designer.cs create mode 100644 ShareX/Controls/NewsListControl.cs create mode 100644 ShareX/Controls/NewsListControl.resx create mode 100644 ShareX/NewsItem.cs diff --git a/ShareX/Controls/NewsListControl.Designer.cs b/ShareX/Controls/NewsListControl.Designer.cs new file mode 100644 index 000000000..40de9ab1c --- /dev/null +++ b/ShareX/Controls/NewsListControl.Designer.cs @@ -0,0 +1,65 @@ +namespace ShareX +{ + partial class NewsListControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.tlpMain = new System.Windows.Forms.TableLayoutPanel(); + this.SuspendLayout(); + // + // tlpMain + // + this.tlpMain.AutoScroll = true; + this.tlpMain.ColumnCount = 1; + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpMain.Location = new System.Drawing.Point(0, 0); + this.tlpMain.Margin = new System.Windows.Forms.Padding(0); + this.tlpMain.Name = "tlpMain"; + this.tlpMain.RowCount = 1; + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.Size = new System.Drawing.Size(500, 500); + this.tlpMain.TabIndex = 0; + // + // NewsListControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.Controls.Add(this.tlpMain); + this.Margin = new System.Windows.Forms.Padding(0); + this.Name = "NewsListControl"; + this.Size = new System.Drawing.Size(500, 500); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tlpMain; + } +} diff --git a/ShareX/Controls/NewsListControl.cs b/ShareX/Controls/NewsListControl.cs new file mode 100644 index 000000000..c3d15af8a --- /dev/null +++ b/ShareX/Controls/NewsListControl.cs @@ -0,0 +1,83 @@ +#region License Information (GPL v3) + +/* + ShareX - A program that allows you to take screenshots and share any file type + Copyright (c) 2007-2017 ShareX Team + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Optionally you can also view the license at . +*/ + +#endregion License Information (GPL v3) + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using ShareX.HelpersLib; + +namespace ShareX +{ + public partial class NewsListControl : UserControl + { + public List NewsItems = new List(); + + public NewsListControl() + { + InitializeComponent(); + + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX released on Windows Store!" }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX 1.8.0 released." }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "We now have a Discord server!" }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX 1.7.0 released." }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX 1.6.0 released." }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX 1.5.0 released.\nMulti line test.\nTest." }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX 1.4.0 released." }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX 1.3.0 released.\n7 Long text test. 6 Long text test. 5 Long text test. 4 Long text test. 3 Long text test. 2 Long text test. 1 Long text test.\nMulti line test.\nTest." }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX 1.2.0 released." }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX 1.1.0 released." }); + AddNewsItem(new NewsItem() { DateTimeUTC = DateTime.Now, Text = "ShareX 1.0.0 released." }); + } + + public void AddNewsItem(NewsItem item) + { + NewsItems.Add(item); + Label lblNewsItem = new Label() + { + Anchor = AnchorStyles.Left | AnchorStyles.Right, + AutoSize = true, + Font = new Font("Arial", 10), + Margin = new Padding(0), + Padding = new Padding(5, 8, 5, 8), + Text = item.DateTimeUTC.ToLocalTime().ToShortDateString() + " - " + item.Text + }; + lblNewsItem.BackColor = NewsItems.Count.IsEvenNumber() ? Color.FromArgb(250, 250, 250) : Color.FromArgb(245, 245, 245); + AddRow(lblNewsItem); + } + + private void AddRow(Label label) + { + RowStyle style = new RowStyle(SizeType.AutoSize); + tlpMain.RowStyles.Add(style); + int index = tlpMain.RowCount++ - 1; + tlpMain.Controls.Add(label, 0, index); + } + } +} \ No newline at end of file diff --git a/ShareX/Controls/NewsListControl.resx b/ShareX/Controls/NewsListControl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/ShareX/Controls/NewsListControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShareX/Forms/MainForm.Designer.cs b/ShareX/Forms/MainForm.Designer.cs index dd0a1003f..5405b897f 100644 --- a/ShareX/Forms/MainForm.Designer.cs +++ b/ShareX/Forms/MainForm.Designer.cs @@ -239,6 +239,7 @@ 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.newsListControl1 = new ShareX.NewsListControl(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); this.scMain.Panel1.SuspendLayout(); this.scMain.Panel2.SuspendLayout(); @@ -1856,6 +1857,12 @@ private void InitializeComponent() this.ttMain.InitialDelay = 200; this.ttMain.ReshowDelay = 100; // + // newsListControl1 + // + resources.ApplyResources(this.newsListControl1, "newsListControl1"); + this.newsListControl1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.newsListControl1.Name = "newsListControl1"; + // // MainForm // this.AllowDrop = true; @@ -1865,6 +1872,7 @@ private void InitializeComponent() this.Controls.Add(this.flpPatreon); this.Controls.Add(this.scMain); this.Controls.Add(this.tsMain); + this.Controls.Add(this.newsListControl1); this.DoubleBuffered = true; this.Name = "MainForm"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); @@ -2104,5 +2112,6 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem tsmiOpenActionsToolbar; private System.Windows.Forms.ToolStripMenuItem tsmiDeleteSelectedItem; private System.Windows.Forms.ToolStripMenuItem tsmiSearchImage; + private NewsListControl newsListControl1; } } \ No newline at end of file diff --git a/ShareX/Forms/MainForm.resx b/ShareX/Forms/MainForm.resx index f4bfa6991..e3c85a076 100644 --- a/ShareX/Forms/MainForm.resx +++ b/ShareX/Forms/MainForm.resx @@ -183,45 +183,6 @@ 1 - - Filename - - - 150 - - - Status - - - Progress - - - 125 - - - Speed - - - 75 - - - Elapsed - - - 45 - - - Remaining - - - 45 - - - URL - - - 145 - Fill @@ -318,12 +279,105 @@ 3 + + 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, 356 + + + 215, 45 + + + 3 + + + False + + + False + + + flpPatreon + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 567, 17 + 0, 0 @@ -339,9 +393,6 @@ 0 - - 567, 17 - Open ShareX Patreon campaign web page @@ -387,33 +438,6 @@ 1 - - 613, 356 - - - 215, 45 - - - 3 - - - False - - - False - - - flpPatreon - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - 17, 17 @@ -423,6 +447,42 @@ Left + + 0, 0 + + + 6, 6, 6, 6 + + + 160, 407 + + + 1 + + + tsMain + + + System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + MiddleLeft + + + Magenta + + + 147, 20 + + + Capture + 191, 22 @@ -501,17 +561,17 @@ Auto capture... - + MiddleLeft - + Magenta - + 147, 20 - - Capture + + Upload 203, 22 @@ -543,18 +603,6 @@ Drag and drop upload... - - MiddleLeft - - - Magenta - - - 147, 20 - - - Upload - BottomLeft @@ -567,6 +615,18 @@ Workflows + + MiddleLeft + + + Magenta + + + 147, 20 + + + Tools + 183, 22 @@ -651,18 +711,6 @@ Monitor test... - - MiddleLeft - - - Magenta - - - 147, 20 - - - Tools - 147, 6 @@ -690,6 +738,18 @@ After upload tasks + + MiddleLeft + + + Magenta + + + 147, 20 + + + Destinations + 187, 22 @@ -729,18 +789,6 @@ Destination settings... - - MiddleLeft - - - Magenta - - - 147, 20 - - - Destinations - MiddleLeft @@ -816,6 +864,18 @@ Image history... + + MiddleLeft + + + Magenta + + + 147, 20 + + + Debug + 172, 22 @@ -852,18 +912,6 @@ Test URL sharing - - MiddleLeft - - - Magenta - - - 147, 20 - - - Debug - MiddleLeft @@ -888,33 +936,18 @@ About... - - 0, 0 - - - 6, 6, 6, 6 - - - 160, 407 - - - 1 - - - tsMain - - - System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - 286, 17 + + 229, 450 + + + cmsTaskInfo + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 228, 22 @@ -927,6 +960,15 @@ Stop upload + + + + + 228, 22 + + + Open + Enter @@ -981,14 +1023,14 @@ Thumbnail file - + - + 228, 22 - - Open + + Copy Ctrl+C @@ -1134,15 +1176,6 @@ False - - - - - 228, 22 - - - Copy - Ctrl+U @@ -1251,6 +1284,12 @@ Hide columns + + 228, 22 + + + Image preview + 130, 22 @@ -1269,27 +1308,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 @@ -1368,11 +1410,11 @@ Auto capture... - + 192, 22 - - Capture + + Upload 203, 22 @@ -1404,18 +1446,18 @@ Drag and drop upload... - - 192, 22 - - - Upload - 192, 22 Workflows + + 192, 22 + + + Tools + 183, 22 @@ -1500,12 +1542,6 @@ Monitor test... - - 192, 22 - - - Tools - 189, 6 @@ -1521,6 +1557,12 @@ After upload tasks + + 192, 22 + + + Destinations + 187, 22 @@ -1560,12 +1602,6 @@ Destination settings... - - 192, 22 - - - Destinations - 192, 22 @@ -1611,6 +1647,12 @@ Image history... + + 192, 22 + + + Debug + 172, 22 @@ -1647,12 +1689,6 @@ Test URL sharing - - 192, 22 - - - Debug - 192, 22 @@ -1695,21 +1731,39 @@ 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 + + + Top, Bottom, Left, Right + + + 328, 8 + + + 0, 0, 0, 0 + + + 502, 392 + + + 4 + + + newsListControl1 + + + ShareX.NewsListControl, ShareX, Version=11.8.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 5 + True @@ -2920,6 +2974,6 @@ MainForm - ShareX.HotkeyForm, ShareX, Version=11.6.0.0, Culture=neutral, PublicKeyToken=null + ShareX.HotkeyForm, ShareX, Version=11.8.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/ShareX/NewsItem.cs b/ShareX/NewsItem.cs new file mode 100644 index 000000000..74928098a --- /dev/null +++ b/ShareX/NewsItem.cs @@ -0,0 +1,39 @@ +#region License Information (GPL v3) + +/* + ShareX - A program that allows you to take screenshots and share any file type + Copyright (c) 2007-2017 ShareX Team + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Optionally you can also view the license at . +*/ + +#endregion License Information (GPL v3) + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ShareX +{ + public class NewsItem + { + public DateTime DateTimeUTC { get; set; } + public string Text { get; set; } + public string URL { get; set; } + } +} \ No newline at end of file diff --git a/ShareX/ShareX.csproj b/ShareX/ShareX.csproj index 07bbc7a85..3533a15dc 100644 --- a/ShareX/ShareX.csproj +++ b/ShareX/ShareX.csproj @@ -135,6 +135,13 @@ BeforeUploadControl.cs + + UserControl + + + NewsListControl.cs + + Form @@ -358,6 +365,9 @@ HotkeySelectionControl.cs + + NewsListControl.cs + AboutForm.cs