Skip to content

Commit

Permalink
Fix some code styles
Browse files Browse the repository at this point in the history
  • Loading branch information
bezzad committed Aug 22, 2017
1 parent 7a71783 commit 77de3ab
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
14 changes: 9 additions & 5 deletions MaterialSkin/Controls/MaterialCheckbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace MaterialSkin.Controls
{
public class MaterialCheckBox : CheckBox, IMaterialControl
{
#region Properties

[Browsable(false)]
public int Depth { get; set; }
[Browsable(false)]
Expand Down Expand Up @@ -40,14 +42,16 @@ public bool Ripple

private readonly AnimationManager _animationManager;
private readonly AnimationManager _rippleAnimationManager;

private const int CheckboxSize = 18;
private const int CheckboxSizeHalf = CheckboxSize / 2;
private const int CheckboxInnerBoxSize = CheckboxSize - 4;

private static readonly Point[] CheckmarkLine = { new Point(3, 8), new Point(7, 12), new Point(14, 5) };
private const int TextOffset = 22;
private int _boxOffset;
private Rectangle _boxRectangle;

#endregion

public MaterialCheckBox()
{
_animationManager = new AnimationManager
Expand All @@ -73,6 +77,8 @@ public MaterialCheckBox()
MouseLocation = new Point(-1, -1);
}



protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
Expand All @@ -86,9 +92,7 @@ public override Size GetPreferredSize(Size proposedSize)
var w = _boxOffset + CheckboxSize + 2 + (int)CreateGraphics().MeasureString(Text, SkinManager.NazanintarMedium11).Width;
return Ripple ? new Size(w, 30) : new Size(w, 20);
}

private static readonly Point[] CheckmarkLine = { new Point(3, 8), new Point(7, 12), new Point(14, 5) };
private const int TextOffset = 22;

protected override void OnPaint(PaintEventArgs pevent)
{
var g = pevent.Graphics;
Expand Down
32 changes: 18 additions & 14 deletions MaterialSkinExample/MainForm.Designer.cs

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

0 comments on commit 77de3ab

Please sign in to comment.