This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
gwen-dotnet/Gwen/ControlInternal/PropertyRowLabel.cs
Gered 10e057953e initial commit
Contains changes from "gwen-dotnet" removing dependancies on Windows,
which ultimately means certain features (e.g. file load/save dialogs)
do not work. Those classes still exist, but the code has been commented
out.
2013-03-28 18:47:01 -04:00

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;
}
}
}