From 64ff083c98b6287261df31dc05c68a0d319efb84 Mon Sep 17 00:00:00 2001 From: Jaex Date: Sat, 21 Nov 2015 00:56:07 +0200 Subject: [PATCH] Show ShareX logo in about window --- ShareX.HelpersLib/Controls/Canvas.cs | 13 ++++--- ShareX/Forms/AboutForm.Designer.cs | 20 ++++++++-- ShareX/Forms/AboutForm.cs | 7 +++- ShareX/Forms/AboutForm.resx | 57 ++++++++++++++++++++-------- 4 files changed, 73 insertions(+), 24 deletions(-) diff --git a/ShareX.HelpersLib/Controls/Canvas.cs b/ShareX.HelpersLib/Controls/Canvas.cs index 7fdb95d45..0a8322335 100644 --- a/ShareX.HelpersLib/Controls/Canvas.cs +++ b/ShareX.HelpersLib/Controls/Canvas.cs @@ -48,12 +48,15 @@ public Canvas() public void Start() { - Stop(); + if (timer == null || !timer.Enabled) + { + Stop(); - timer = new Timer(); - timer.Interval = Interval; - timer.Tick += timer_Tick; - timer.Start(); + timer = new Timer(); + timer.Interval = Interval; + timer.Tick += timer_Tick; + timer.Start(); + } } public void Start(int interval) diff --git a/ShareX/Forms/AboutForm.Designer.cs b/ShareX/Forms/AboutForm.Designer.cs index 54fe8dee3..e7e2fdd28 100644 --- a/ShareX/Forms/AboutForm.Designer.cs +++ b/ShareX/Forms/AboutForm.Designer.cs @@ -46,11 +46,13 @@ private void InitializeComponent() this.lblTeam = new System.Windows.Forms.Label(); this.lblSteamBuild = new System.Windows.Forms.Label(); this.pbSteam = new System.Windows.Forms.PictureBox(); + this.pbLogo = new System.Windows.Forms.PictureBox(); ((System.ComponentModel.ISupportInitialize)(this.pbMikeURL)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbAU)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbBerkURL)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbTR)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbSteam)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbLogo)).BeginInit(); this.SuspendLayout(); // // lblProductName @@ -76,7 +78,7 @@ private void InitializeComponent() // rtbCredits // resources.ApplyResources(this.rtbCredits, "rtbCredits"); - this.rtbCredits.BackColor = System.Drawing.Color.WhiteSmoke; + this.rtbCredits.BackColor = System.Drawing.Color.White; this.rtbCredits.BorderStyle = System.Windows.Forms.BorderStyle.None; this.rtbCredits.Name = "rtbCredits"; this.rtbCredits.ReadOnly = true; @@ -84,7 +86,7 @@ private void InitializeComponent() // // rtbShareXInfo // - this.rtbShareXInfo.BackColor = System.Drawing.Color.WhiteSmoke; + this.rtbShareXInfo.BackColor = System.Drawing.Color.White; this.rtbShareXInfo.BorderStyle = System.Windows.Forms.BorderStyle.None; resources.ApplyResources(this.rtbShareXInfo, "rtbShareXInfo"); this.rtbShareXInfo.Name = "rtbShareXInfo"; @@ -148,6 +150,7 @@ private void InitializeComponent() // lblSteamBuild // resources.ApplyResources(this.lblSteamBuild, "lblSteamBuild"); + this.lblSteamBuild.BackColor = System.Drawing.Color.Transparent; this.lblSteamBuild.Name = "lblSteamBuild"; // // pbSteam @@ -160,11 +163,20 @@ private void InitializeComponent() this.pbSteam.TabStop = false; this.pbSteam.Click += new System.EventHandler(this.pbSteam_Click); // + // pbLogo + // + resources.ApplyResources(this.pbLogo, "pbLogo"); + this.pbLogo.BackColor = System.Drawing.Color.Transparent; + this.pbLogo.Name = "pbLogo"; + this.pbLogo.TabStop = false; + this.pbLogo.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbLogo_MouseDown); + // // AboutForm // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.WhiteSmoke; + this.BackColor = System.Drawing.Color.White; + this.Controls.Add(this.pbLogo); this.Controls.Add(this.pbSteam); this.Controls.Add(this.lblSteamBuild); this.Controls.Add(this.lblTeam); @@ -188,6 +200,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.pbBerkURL)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pbTR)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pbSteam)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbLogo)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -209,5 +222,6 @@ private void InitializeComponent() private System.Windows.Forms.Label lblTeam; private System.Windows.Forms.Label lblSteamBuild; private System.Windows.Forms.PictureBox pbSteam; + private System.Windows.Forms.PictureBox pbLogo; } } \ No newline at end of file diff --git a/ShareX/Forms/AboutForm.cs b/ShareX/Forms/AboutForm.cs index e9665efd4..344c55e7a 100644 --- a/ShareX/Forms/AboutForm.cs +++ b/ShareX/Forms/AboutForm.cs @@ -38,6 +38,7 @@ public AboutForm() { InitializeComponent(); lblProductName.Text = Program.Title; + pbLogo.Image = ShareXResources.Logo; rtbShareXInfo.AddContextMenu(); rtbCredits.AddContextMenu(); @@ -121,7 +122,12 @@ public AboutForm() private void AboutForm_Shown(object sender, EventArgs e) { this.ShowActivate(); + } + + private void pbLogo_MouseDown(object sender, MouseEventArgs e) + { cLogo.Start(50); + pbLogo.Visible = false; } private void pbSteam_Click(object sender, EventArgs e) @@ -254,7 +260,6 @@ private void cLogo_MouseDown(object sender, MouseEventArgs e) if (clickCount >= 10) { isEasterEggStarted = true; - cLogo.Stop(); RunEasterEgg(); } } diff --git a/ShareX/Forms/AboutForm.resx b/ShareX/Forms/AboutForm.resx index b7aabc7e3..41c24db66 100644 --- a/ShareX/Forms/AboutForm.resx +++ b/ShareX/Forms/AboutForm.resx @@ -123,13 +123,13 @@ - Microsoft Sans Serif, 14.25pt + Verdana, 14.25pt 12, 8 - 0, 24 + 0, 23 0 @@ -147,7 +147,7 @@ $this - 12 + 13 True @@ -171,7 +171,7 @@ $this - 5 + 6 True @@ -195,7 +195,7 @@ $this - 6 + 7 @@ -226,7 +226,7 @@ $this - 4 + 5 16, 66 @@ -250,7 +250,7 @@ $this - 3 + 4 Top, Right @@ -274,7 +274,7 @@ $this - 13 + 14 14, 35 @@ -295,7 +295,7 @@ $this - 7 + 8 41, 185 @@ -319,7 +319,7 @@ $this - 8 + 9 17, 185 @@ -343,7 +343,7 @@ $this - 9 + 10 41, 161 @@ -367,7 +367,7 @@ $this - 10 + 11 17, 161 @@ -391,7 +391,7 @@ $this - 11 + 12 True @@ -415,7 +415,7 @@ $this - 2 + 3 True @@ -445,7 +445,7 @@ $this - 1 + 2 NoControl @@ -472,6 +472,33 @@ $this + 1 + + + Top, Right + + + 376, 8 + + + 200, 200 + + + Zoom + + + 18 + + + pbLogo + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0