Puddles & spreader refactor (#15191)
This commit is contained in:
7
Content.Client/UserInterface/Controls/SplitBar.xaml
Normal file
7
Content.Client/UserInterface/Controls/SplitBar.xaml
Normal file
@@ -0,0 +1,7 @@
|
||||
<controls:SplitBar xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
MouseFilter="Stop"
|
||||
Orientation="Horizontal"
|
||||
HorizontalExpand="True"
|
||||
MinSize="0 30">
|
||||
</controls:SplitBar>
|
||||
39
Content.Client/UserInterface/Controls/SplitBar.xaml.cs
Normal file
39
Content.Client/UserInterface/Controls/SplitBar.xaml.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client.UserInterface.Controls
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class SplitBar : BoxContainer
|
||||
{
|
||||
public SplitBar()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
DisposeAllChildren();
|
||||
}
|
||||
|
||||
public void AddEntry(float amount, Color color, string? tooltip = null)
|
||||
{
|
||||
AddChild(new PanelContainer
|
||||
{
|
||||
ToolTip = tooltip,
|
||||
HorizontalExpand = true,
|
||||
SizeFlagsStretchRatio = amount,
|
||||
MouseFilter = MouseFilterMode.Stop,
|
||||
PanelOverride = new StyleBoxFlat
|
||||
{
|
||||
BackgroundColor = color,
|
||||
PaddingLeft = 2f,
|
||||
PaddingRight = 2f,
|
||||
},
|
||||
MinSize = new Vector2(24, 0)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user