Skip to content

Commit

Permalink
Fix for enabling cancel button.
Browse files Browse the repository at this point in the history
  • Loading branch information
clown committed Aug 21, 2017
1 parent 67d3a69 commit 6953f10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Applications/Ice/Views/ProgressForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Applications/Ice/Views/ProgressForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ public int Value
{
if (MainProgressBar.Value == value) return;

MainProgressBar.Style = value > 0 ?
ProgressBarStyle.Continuous :
ProgressBarStyle.Marquee;

var min = MainProgressBar.Minimum;
var max = MainProgressBar.Maximum;
MainProgressBar.Value = Math.Min(Math.Max(value, min), max);

ExitButton.Enabled =
SuspendButton.Enabled = value > 0;

UpdateTitle();
Expand Down Expand Up @@ -110,10 +115,6 @@ public int Unit
{
if (MainProgressBar.Maximum == value) return;
MainProgressBar.Maximum = value;
MainProgressBar.Style = value > 0 ?
ProgressBarStyle.Continuous :
ProgressBarStyle.Marquee;
ExitButton.Enabled = value > 0;
}
}

Expand Down

0 comments on commit 6953f10

Please sign in to comment.