Skip to content

Commit

Permalink
Merge pull request #254 from leocb/orapps44-MaterialProgressBar-disabled
Browse files Browse the repository at this point in the history
Fix MaterialProgressBar disabled mode colors
  • Loading branch information
orapps44 authored Oct 20, 2021
2 parents 6a9d4f3 + 9a11d9c commit 65608a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions MaterialSkin/Controls/MaterialProgressBar.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace MaterialSkin.Controls
{
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

public class MaterialProgressBar : ProgressBar, IMaterialControl
Expand Down Expand Up @@ -28,8 +29,11 @@ protected override void SetBoundsCore(int x, int y, int width, int height, Bound
protected override void OnPaint(PaintEventArgs e)
{
var doneProgress = (int)(Width * ((double)Value / Maximum));
e.Graphics.FillRectangle(SkinManager.ColorScheme.PrimaryBrush, 0, 0, doneProgress, Height);
e.Graphics.FillRectangle(Enabled ?
SkinManager.ColorScheme.PrimaryBrush :
new SolidBrush(DrawHelper.BlendColor(SkinManager.ColorScheme.PrimaryColor, SkinManager.SwitchOffDisabledThumbColor, 197)),
0, 0, doneProgress, Height);
e.Graphics.FillRectangle(SkinManager.BackgroundFocusBrush, doneProgress, 0, Width - doneProgress, Height);
}
}
}
}

0 comments on commit 65608a8

Please sign in to comment.