From 189e3271a0c919d48d75810ddd2e152e9da4718c Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Thu, 8 Oct 2020 22:03:02 +1300 Subject: [PATCH] Fixed incorrectly displaying progressBar I broke the circularProgressBar but now it works fine. Messed with the style a bit to get the look I wanted. Also adjusted the positioning of the text in the middle. --- HeliosPlus/Program.cs | 4 ++-- .../UIForms/ApplyingProfileForm.Designer.cs | 24 +++++++++---------- HeliosPlus/UIForms/ApplyingProfileForm.cs | 6 +++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/HeliosPlus/Program.cs b/HeliosPlus/Program.cs index 1999338..e6095b8 100644 --- a/HeliosPlus/Program.cs +++ b/HeliosPlus/Program.cs @@ -329,8 +329,8 @@ namespace HeliosPlus { // Set up the UI forms to show ApplyingProfileForm timeoutForm = new ApplyingProfileForm(null, 3, $"Changing to '{profile.Name}' Profile", "Press ESC to cancel", Color.Orange, true); - ApplyingProfileForm topologyForm = new ApplyingProfileForm(applyTopologyTask, 15, $"Changing to '{profile.Name}' Profile", "Applying NVIDIA Grid Topology", Color.Aquamarine); - ApplyingProfileForm pathInfoForm = new ApplyingProfileForm(applyPathInfoTask, 15, $"Changing to '{profile.Name}' Profile", "Applying Windows Display Device settings", Color.LawnGreen); + ApplyingProfileForm topologyForm = new ApplyingProfileForm(applyTopologyTask, 30, $"Changing to '{profile.Name}' Profile", "Applying NVIDIA Grid Topology", Color.Aquamarine); + ApplyingProfileForm pathInfoForm = new ApplyingProfileForm(applyPathInfoTask, 15, $"Changing to '{profile.Name}' Profile", "Adjusting Windows Display Device positions", Color.LawnGreen); if (timeoutForm.ShowDialog() == DialogResult.Cancel) { diff --git a/HeliosPlus/UIForms/ApplyingProfileForm.Designer.cs b/HeliosPlus/UIForms/ApplyingProfileForm.Designer.cs index 756ad15..c2ce029 100644 --- a/HeliosPlus/UIForms/ApplyingProfileForm.Designer.cs +++ b/HeliosPlus/UIForms/ApplyingProfileForm.Designer.cs @@ -44,16 +44,16 @@ this.progressPanel.Controls.Add(this.lbl_sub_message); this.progressPanel.Controls.Add(this.progressBar); this.progressPanel.Controls.Add(this.lbl_message); - this.progressPanel.Location = new System.Drawing.Point(77, 154); + this.progressPanel.Location = new System.Drawing.Point(40, 154); this.progressPanel.Name = "progressPanel"; - this.progressPanel.Size = new System.Drawing.Size(621, 270); + this.progressPanel.Size = new System.Drawing.Size(720, 270); this.progressPanel.TabIndex = 1; // // lbl_sub_message // this.lbl_sub_message.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_sub_message.ForeColor = System.Drawing.Color.White; - this.lbl_sub_message.Location = new System.Drawing.Point(73, 67); + this.lbl_sub_message.Location = new System.Drawing.Point(110, 67); this.lbl_sub_message.Name = "lbl_sub_message"; this.lbl_sub_message.Size = new System.Drawing.Size(501, 30); this.lbl_sub_message.TabIndex = 2; @@ -63,20 +63,20 @@ // this.progressBar.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progressBar.AnimationSpeed = 1000; - this.progressBar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50))))); + this.progressBar.BackColor = System.Drawing.Color.Transparent; this.progressBar.Font = new System.Drawing.Font("Microsoft Sans Serif", 39.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.progressBar.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.progressBar.InnerColor = System.Drawing.Color.Ivory; + this.progressBar.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50))))); this.progressBar.InnerMargin = 0; - this.progressBar.InnerWidth = 0; - this.progressBar.Location = new System.Drawing.Point(243, 125); + this.progressBar.InnerWidth = 1; + this.progressBar.Location = new System.Drawing.Point(293, 115); this.progressBar.MarqueeAnimationSpeed = 2000; this.progressBar.Name = "progressBar"; this.progressBar.OuterColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.progressBar.OuterMargin = -15; - this.progressBar.OuterWidth = 15; + this.progressBar.OuterMargin = 0; + this.progressBar.OuterWidth = 0; this.progressBar.ProgressColor = System.Drawing.Color.DodgerBlue; - this.progressBar.ProgressWidth = 15; + this.progressBar.ProgressWidth = 23; this.progressBar.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.progressBar.Size = new System.Drawing.Size(135, 135); this.progressBar.StartAngle = 270; @@ -87,7 +87,7 @@ this.progressBar.SuperscriptMargin = new System.Windows.Forms.Padding(0, 30, 0, 0); this.progressBar.SuperscriptText = ""; this.progressBar.TabIndex = 0; - this.progressBar.TextMargin = new System.Windows.Forms.Padding(2, 5, 0, 0); + this.progressBar.TextMargin = new System.Windows.Forms.Padding(0, 4, 1, 0); this.progressBar.Value = 68; // // lbl_message @@ -96,7 +96,7 @@ this.lbl_message.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.lbl_message.Location = new System.Drawing.Point(3, 0); this.lbl_message.Name = "lbl_message"; - this.lbl_message.Size = new System.Drawing.Size(615, 61); + this.lbl_message.Size = new System.Drawing.Size(714, 61); this.lbl_message.TabIndex = 1; this.lbl_message.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // diff --git a/HeliosPlus/UIForms/ApplyingProfileForm.cs b/HeliosPlus/UIForms/ApplyingProfileForm.cs index 75f1426..f9419bd 100644 --- a/HeliosPlus/UIForms/ApplyingProfileForm.cs +++ b/HeliosPlus/UIForms/ApplyingProfileForm.cs @@ -41,7 +41,7 @@ namespace HeliosPlus.UIForms Cancellable = cancellable; TaskToRun = taskToRun; if (progressColor.Equals(default(Color))) - progressColor = Color.Red; + progressColor = Color.OrangeRed; ProgressColor = progressColor; if (!string.IsNullOrEmpty(title)) Title = title; if (!string.IsNullOrEmpty(message)) Message = message; @@ -113,7 +113,7 @@ namespace HeliosPlus.UIForms progressBar.ProgressColor = ProgressColor; progressBar.Maximum = _countdownCounter; progressBar.Value = _countdownCounter; - progressBar.Text = (_countdownCounter).ToString(); + progressBar.Text = _countdownCounter.ToString(); t_countdown.Start(); if (TaskToRun is Task) TaskToRun.Start(); @@ -193,6 +193,7 @@ namespace HeliosPlus.UIForms private void ApplyingProfileForm_Shown(object sender, EventArgs e) { + Reposition(); new Animator(new Path((float)Opacity, 0.97f, 200)) .Play(new SafeInvoker(f => { @@ -216,6 +217,7 @@ namespace HeliosPlus.UIForms if (_countdownCounter <= 0) { + _countdownCounter = 0; t_countdown.Stop(); DialogResult = DialogResult.OK; Close();