Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ReadOnly, Fixed AutoSize #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MaterialSkin/Controls/MaterialFlatButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public MaterialFlatButton()
_animationManager.OnAnimationProgress += sender => Invalidate();

AutoSizeMode = AutoSizeMode.GrowAndShrink;
AutoSize = true;
AutoSize = false;
Margin = new Padding(4, 6, 4, 6);
Padding = new Padding(0);
}
Expand Down
4 changes: 3 additions & 1 deletion MaterialSkin/Controls/MaterialRaisedButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public Image Icon
}
}



public MaterialRaisedButton()
{
Primary = true;
Expand All @@ -47,7 +49,7 @@ public MaterialRaisedButton()
_animationManager.OnAnimationProgress += sender => Invalidate();

AutoSizeMode = AutoSizeMode.GrowAndShrink;
AutoSize = true;
AutoSize = false;
}

public override string Text
Expand Down
15 changes: 15 additions & 0 deletions MaterialSkin/Controls/MaterialSingleLineTextField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ public class MaterialSingleLineTextField : Control, IMaterialControl
private readonly BaseTextBox _baseTextBox;
private readonly AnimationManager _animationManager;

bool readOnly;
public bool ReadOnly
{
get { return readOnly; }
set
{
readOnly = value;
_baseTextBox.ReadOnly = value;
}
}


public override string Text { get { return _baseTextBox.Text; } set { _baseTextBox.Text = value; } }
public new object Tag { get { return _baseTextBox.Tag; } set { _baseTextBox.Tag = value; } }
public new int MaxLength { get { return _baseTextBox.MaxLength; } set { _baseTextBox.MaxLength = value; } }
Expand All @@ -34,10 +46,13 @@ public class MaterialSingleLineTextField : Control, IMaterialControl
public bool UseSystemPasswordChar { get { return _baseTextBox.UseSystemPasswordChar; } set { _baseTextBox.UseSystemPasswordChar = value; } }
public char PasswordChar { get { return _baseTextBox.PasswordChar; } set { _baseTextBox.PasswordChar = value; } }



public void SelectAll() { _baseTextBox.SelectAll(); }
public void Clear() { _baseTextBox.Clear(); }
public void Focus() { _baseTextBox.Focus(); }



# region Forwarding events to baseTextBox
public event EventHandler AcceptsTabChanged
Expand Down