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

@@ -10,6 +10,7 @@ using Robust.Shared.Configuration;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.EscapeMenu.UI
{
@@ -47,10 +48,14 @@ namespace Content.Client.EscapeMenu.UI
{
_cfg = cfg;
_prototypeManager = proMan;
var vBox = new VBoxContainer();
var contents = new VBoxContainer
var vBox = new BoxContainer
{
Orientation = LayoutOrientation.Vertical
};
var contents = new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Margin = new Thickness(2, 2, 2, 0),
VerticalExpand = true,
};
@@ -70,8 +75,9 @@ namespace Content.Client.EscapeMenu.UI
LightingPresetOption.AddItem(Loc.GetString("ui-options-lighting-high"));
LightingPresetOption.OnItemSelected += OnLightingQualityChanged;
contents.AddChild(new HBoxContainer
contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label {Text = Loc.GetString("ui-options-lighting-label")},
@@ -97,8 +103,9 @@ namespace Content.Client.EscapeMenu.UI
_uiScaleOption.AddItem(Loc.GetString("ui-options-scale-200"));
_uiScaleOption.OnItemSelected += OnUIScaleChanged;
contents.AddChild(new HBoxContainer
contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label {Text = Loc.GetString("ui-options-scale-label")},
@@ -114,8 +121,9 @@ namespace Content.Client.EscapeMenu.UI
}
_hudThemeOption.OnItemSelected += OnHudThemeChanged;
contents.AddChild(new HBoxContainer
contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Label {Text = Loc.GetString("ui-options-hud-theme")},
@@ -152,13 +160,15 @@ namespace Content.Client.EscapeMenu.UI
_viewportLowResCheckBox = new CheckBox { Text = Loc.GetString("ui-options-vp-low-res")};
_viewportLowResCheckBox.OnToggled += OnCheckBoxToggled;
contents.AddChild(new HBoxContainer
contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
_viewportStretchCheckBox,
(_viewportScaleBox = new HBoxContainer
(_viewportScaleBox = new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
(_viewportScaleText = new Label