Use Border override

This commit is contained in:
John Lewin 2018-10-17 09:00:24 -07:00
parent 4f0f790f56
commit fd793e076a

View file

@ -1,5 +1,5 @@
/*
Copyright (c) 2017, Lars Brubaker, John Lewin
Copyright (c) 2018, Lars Brubaker, John Lewin
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -91,6 +91,30 @@ namespace MatterHackers.MatterControl
set => base.BackgroundColor = value;
}
public override Color BorderColor
{
get
{
if (base.BorderColor != Color.Transparent)
{
return base.BackgroundColor;
}
else if (this.ContainsFocus)
{
return theme.EditFieldColors.Focused.BorderColor;
}
else if (this.mouseInBounds)
{
return theme.EditFieldColors.Hovered.BorderColor;
}
else
{
return theme.EditFieldColors.Inactive.BorderColor;
}
}
set => base.BorderColor = value;
}
private bool mouseInBounds = false;
public override void OnMouseEnterBounds(MouseEventArgs mouseEvent)