Lobby Refactor (#7077)
This commit is contained in:
46
Content.Client/UserInterface/Controls/HLine.cs
Normal file
46
Content.Client/UserInterface/Controls/HLine.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
21
Content.Client/UserInterface/Controls/HSpacer.cs
Normal file
21
Content.Client/UserInterface/Controls/HSpacer.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.Maths;
|
||||
using TerraFX.Interop.Windows;
|
||||
|
||||
namespace Content.Client.UserInterface.Controls;
|
||||
|
||||
public sealed class HSpacer : Control
|
||||
{
|
||||
public float Spacing { get => MinHeight; set => MinHeight = value; }
|
||||
public HSpacer()
|
||||
{
|
||||
MinHeight = Spacing;
|
||||
}
|
||||
public HSpacer(float height = 5)
|
||||
{
|
||||
Spacing = height;
|
||||
MinHeight = height;
|
||||
}
|
||||
}
|
||||
20
Content.Client/UserInterface/Controls/VSpacer.cs
Normal file
20
Content.Client/UserInterface/Controls/VSpacer.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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 VSpacer : Control
|
||||
{
|
||||
public float Spacing{ get => MinWidth; set => MinWidth = value; }
|
||||
public VSpacer()
|
||||
{
|
||||
MinWidth = Spacing;
|
||||
}
|
||||
public VSpacer(float width = 5)
|
||||
{
|
||||
Spacing = width;
|
||||
MinWidth = width;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user