2020-04-04 15:10:51 +02:00
|
|
|
using Content.Client.UserInterface.Stylesheets;
|
2019-10-18 14:28:24 +02:00
|
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
|
using Robust.Shared.Maths;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.UserInterface
|
|
|
|
|
{
|
|
|
|
|
public class NanoHeading : Container
|
|
|
|
|
{
|
|
|
|
|
private readonly Label _label;
|
|
|
|
|
private readonly PanelContainer _panel;
|
|
|
|
|
|
|
|
|
|
public NanoHeading()
|
|
|
|
|
{
|
|
|
|
|
_panel = new PanelContainer
|
|
|
|
|
{
|
|
|
|
|
Children = {(_label = new Label
|
|
|
|
|
{
|
2020-04-04 15:10:51 +02:00
|
|
|
StyleClasses = {StyleNano.StyleClassLabelHeading}
|
2019-10-18 14:28:24 +02:00
|
|
|
})}
|
|
|
|
|
};
|
|
|
|
|
AddChild(_panel);
|
|
|
|
|
|
|
|
|
|
SizeFlagsHorizontal = SizeFlags.None;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Text
|
|
|
|
|
{
|
|
|
|
|
get => _label.Text;
|
|
|
|
|
set => _label.Text = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override Vector2 CalculateMinimumSize()
|
|
|
|
|
{
|
|
|
|
|
return _panel.CombinedMinimumSize;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-05 16:00:03 +01:00
|
|
|
protected override void LayoutUpdateOverride()
|
2019-10-18 14:28:24 +02:00
|
|
|
{
|
|
|
|
|
FitChildInBox(_panel, SizeBox);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|