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

@@ -7,6 +7,7 @@ using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using static Content.Shared.Disposal.Components.SharedDisposalMailingUnitComponent;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Disposal.UI
{
@@ -30,18 +31,21 @@ namespace Content.Client.Disposal.UI
{
MinSize = SetSize = (460, 230);
TargetList = new List<string>();
Contents.AddChild(new HBoxContainer
Contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new VBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
HorizontalExpand = true,
Margin = new Thickness(8, 0),
Children =
{
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label {Text = $"{Loc.GetString("disposal-mailing-unit-window-state-label")} "},
@@ -50,8 +54,9 @@ namespace Content.Client.Disposal.UI
}
},
new Control {MinSize = (0, 10)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
HorizontalExpand = true,
Children =
{
@@ -73,8 +78,9 @@ namespace Content.Client.Disposal.UI
}
},
new Control {MinSize = (0, 10)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
HorizontalExpand = true,
Children =
{
@@ -94,8 +100,9 @@ namespace Content.Client.Disposal.UI
}
},
new Control {MinSize = (0, 10)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
HorizontalExpand = true,
Children =
{
@@ -114,8 +121,9 @@ namespace Content.Client.Disposal.UI
}
},
new Control {MinSize = (0, 10)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
(Power = new CheckButton {Text = Loc.GetString("disposal-mailing-unit-power-button")}),
@@ -123,13 +131,15 @@ namespace Content.Client.Disposal.UI
}
}
},
new VBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Margin = new Thickness(12, 0, 8, 0),
Children =
{
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label
@@ -139,8 +149,9 @@ namespace Content.Client.Disposal.UI
}
},
new Control {MinSize = new Vector2(0, 8)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
VerticalExpand = true,
Children =
{
@@ -161,16 +172,19 @@ namespace Content.Client.Disposal.UI
HorizontalExpand = true,
MinSize = new Vector2(0, 1),
},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new VBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
{
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Margin = new Thickness(4, 0, 0, 0),
Children =
{

View File

@@ -4,6 +4,7 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Localization;
using static Content.Shared.Disposal.Components.SharedDisposalRouterComponent;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Disposal.UI
{
@@ -20,14 +21,16 @@ namespace Content.Client.Disposal.UI
MinSize = SetSize = (500, 110);
Title = Loc.GetString("disposal-router-window-title");
Contents.AddChild(new VBoxContainer
Contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
{
new Label {Text = Loc.GetString("disposal-router-window-tags-label")},
new Control {MinSize = (0, 10)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
(TagInput = new LineEdit

View File

@@ -4,6 +4,7 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Localization;
using static Content.Shared.Disposal.Components.SharedDisposalTaggerComponent;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Disposal.UI
{
@@ -20,14 +21,16 @@ namespace Content.Client.Disposal.UI
MinSize = SetSize = (500, 110);
Title = Loc.GetString("disposal-tagger-window-title");
Contents.AddChild(new VBoxContainer
Contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
{
new Label {Text = Loc.GetString("disposal-tagger-window-tag-input-label")},
new Control {MinSize = (0, 10)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
(TagInput = new LineEdit

View File

@@ -8,6 +8,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using static Content.Shared.Disposal.Components.SharedDisposalUnitComponent;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Disposal.UI
{
@@ -27,12 +28,14 @@ namespace Content.Client.Disposal.UI
IoCManager.InjectDependencies(this);
MinSize = SetSize = (300, 140);
Resizable = false;
Contents.AddChild(new VBoxContainer
Contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
{
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
SeparationOverride = 4,
Children =
{
@@ -41,8 +44,9 @@ namespace Content.Client.Disposal.UI
}
},
new Control {MinSize = (0, 5)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
SeparationOverride = 4,
Children =
{
@@ -59,8 +63,9 @@ namespace Content.Client.Disposal.UI
}
},
new Control {MinSize = (0, 10)},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
(Engage = new Button