Replace most VBox/HBoxContainers with BoxContainers (#4274)

This commit is contained in:
Visne
2021-07-18 18:39:31 +02:00
committed by GitHub
parent 0d1af2c5ff
commit bf493c39b7
101 changed files with 1143 additions and 567 deletions

View File

@@ -6,6 +6,7 @@ using Robust.Shared.Localization;
using Robust.Shared.Maths;
using static Content.Shared.Configurable.SharedConfigurationComponent;
using static Robust.Client.UserInterface.Controls.BaseButton;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Configurable.UI
{
@@ -13,9 +14,8 @@ namespace Content.Client.Configurable.UI
{
public ConfigurationBoundUserInterface Owner { get; }
private readonly VBoxContainer _baseContainer;
private readonly VBoxContainer _column;
private readonly HBoxContainer _row;
private readonly BoxContainer _column;
private readonly BoxContainer _row;
private readonly List<(string name, LineEdit input)> _inputs;
@@ -28,20 +28,23 @@ namespace Content.Client.Configurable.UI
Title = Loc.GetString("configuration-menu-device-title");
_baseContainer = new VBoxContainer
BoxContainer baseContainer = new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
VerticalExpand = true,
HorizontalExpand = true
};
_column = new VBoxContainer
_column = new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Margin = new Thickness(8),
SeparationOverride = 16,
};
_row = new HBoxContainer
_row = new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
SeparationOverride = 16,
HorizontalExpand = true
};
@@ -63,9 +66,9 @@ namespace Content.Client.Configurable.UI
};
outerColumn.AddChild(_column);
_baseContainer.AddChild(outerColumn);
_baseContainer.AddChild(confirmButton);
Contents.AddChild(_baseContainer);
baseContainer.AddChild(outerColumn);
baseContainer.AddChild(confirmButton);
Contents.AddChild(baseContainer);
}
public void Populate(ConfigurationBoundUserInterfaceState state)
@@ -97,7 +100,10 @@ namespace Content.Client.Configurable.UI
_inputs.Add((field.Key, input));
var row = new HBoxContainer();
var row = new BoxContainer
{
Orientation = LayoutOrientation.Horizontal
};
CopyProperties(_row, row);
row.AddChild(label);