Lobby Refactor (#7077)

This commit is contained in:
Jesse Rougeau
2022-03-13 19:33:19 -07:00
committed by GitHub
parent 8470e83af4
commit 8418098dd8
17 changed files with 278 additions and 250 deletions

View File

@@ -0,0 +1,46 @@
using Content.Client.Stylesheets;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Maths;
namespace Content.Client.UserInterface.Controls;
public sealed class HLine : Container
{
public Color? Color
{
get
{
if (_line.PanelOverride is StyleBoxFlat styleBox) return styleBox.BackgroundColor;
return null;
}
set
{
if (_line.PanelOverride is StyleBoxFlat styleBox) styleBox.BackgroundColor = value!.Value;
}
}
public float? Thickness {
get
{
if (_line.PanelOverride is StyleBoxFlat styleBox) return styleBox.ContentMarginTopOverride;
return null;
}
set
{
if (_line.PanelOverride is StyleBoxFlat styleBox) styleBox.ContentMarginTopOverride = value!.Value;
}
}
private readonly PanelContainer _line;
public HLine()
{
_line = new PanelContainer();
_line.PanelOverride = new StyleBoxFlat();
_line.PanelOverride.ContentMarginTopOverride = Thickness;
AddChild(_line);
}
}