using System;
using Gwen.Control;
namespace Gwen.ControlInternal
{
///
/// Label for PropertyRow.
///
public class PropertyRowLabel : Label
{
private readonly PropertyRow m_PropertyRow;
///
/// Initializes a new instance of the class.
///
/// Parent control.
public PropertyRowLabel(PropertyRow parent)
: base(parent)
{
Alignment = Pos.Left | Pos.CenterV;
m_PropertyRow = parent;
}
///
/// Updates control colors.
///
public override void UpdateColors()
{
if (IsDisabled)
{
TextColor = Skin.Colors.Button.Disabled;
return;
}
if (m_PropertyRow != null && m_PropertyRow.IsEditing)
{
TextColor = Skin.Colors.Properties.Label_Selected;
return;
}
if (m_PropertyRow != null && m_PropertyRow.IsHovered)
{
TextColor = Skin.Colors.Properties.Label_Hover;
return;
}
TextColor = Skin.Colors.Properties.Label_Normal;
}
}
}