Change MHTextEditWidget anchoring

This commit is contained in:
John Lewin 2018-01-17 12:05:46 -08:00
parent 22d961acbd
commit ea3fa0bd2c

View file

@ -45,13 +45,12 @@ namespace MatterHackers.MatterControl
{
this.Padding = new BorderDouble(3);
this.BackgroundColor = Color.White;
this.HAnchor = HAnchor.Stretch;
this.HAnchor = HAnchor.Fit;
this.VAnchor = VAnchor.Fit;
this.ActualTextEditWidget = new TextEditWidget(text, x, y, pointSize, pixelWidth, pixelHeight, multiLine, tabIndex: tabIndex, typeFace: typeFace)
{
VAnchor = VAnchor.Bottom,
HAnchor = HAnchor.Stretch,
VAnchor = VAnchor.Bottom
};
this.ActualTextEditWidget.MinimumSize = new Vector2(Math.Max(ActualTextEditWidget.MinimumSize.X, pixelWidth), Math.Max(ActualTextEditWidget.MinimumSize.Y, pixelHeight));
this.AddChild(this.ActualTextEditWidget);
@ -65,6 +64,16 @@ namespace MatterHackers.MatterControl
SetNoContentFieldDescriptionVisibility();
}
public override HAnchor HAnchor
{
get => base.HAnchor;
set
{
base.HAnchor = value;
if(ActualTextEditWidget != null) ActualTextEditWidget.HAnchor = value;
}
}
private void SetNoContentFieldDescriptionVisibility()
{
if (noContentFieldDescription != null)