51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
|
using System;
|
|||
|
using Gwen.Control;
|
|||
|
|
|||
|
namespace Gwen.ControlInternal
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Label for PropertyRow.
|
|||
|
/// </summary>
|
|||
|
public class PropertyRowLabel : Label
|
|||
|
{
|
|||
|
private readonly PropertyRow m_PropertyRow;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Initializes a new instance of the <see cref="PropertyRowLabel"/> class.
|
|||
|
/// </summary>
|
|||
|
/// <param name="parent">Parent control.</param>
|
|||
|
public PropertyRowLabel(PropertyRow parent)
|
|||
|
: base(parent)
|
|||
|
{
|
|||
|
Alignment = Pos.Left | Pos.CenterV;
|
|||
|
m_PropertyRow = parent;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Updates control colors.
|
|||
|
/// </summary>
|
|||
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|