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

@@ -8,6 +8,7 @@ using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Prototypes;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Administration.UI
{
@@ -65,8 +66,9 @@ namespace Content.Client.Administration.UI
Title = Loc.GetString("admin-add-reagent-eui-title");
Contents.AddChild(new VBoxContainer
Contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
{
new GridContainer
@@ -88,8 +90,9 @@ namespace Content.Client.Administration.UI
HorizontalExpand = true,
VerticalExpand = true
},
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
Children =
{
(_errorLabel = new Label

View File

@@ -1,13 +1,13 @@
<VBoxContainer
<BoxContainer Orientation="Vertical"
xmlns="https://spacestation14.io">
<Control CustomMinimumSize="0 5" />
<HBoxContainer>
<BoxContainer Orientation="Horizontal">
<!-- <Label Text="{Loc Search}" CustomMinimumSize="100 0" /> -->
<!-- <Control CustomMinimumSize="50 0" /> -->
<LineEdit Name="FilterLineEdit" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" PlaceHolder="{Loc Filter}"/>
</HBoxContainer>
</BoxContainer>
<!-- <Control CustomMinimumSize="0 5" /> -->
<ItemList
Name="PlayerItemList" SelectMode="Single" SizeFlagsVertical="FillExpand" SizeFlagsHorizontal="FillExpand"
CustomMinimumSize="100 100" />
</VBoxContainer>
</BoxContainer>

View File

@@ -14,6 +14,7 @@ using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Utility;
using static Content.Shared.Administration.PermissionsEuiMsg;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Administration.UI
{
@@ -316,15 +317,17 @@ namespace Content.Client.Administration.UI
};
AdminsList = new GridContainer {Columns = 5, VerticalExpand = true};
var adminVBox = new VBoxContainer
var adminVBox = new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children = {AdminsList, AddAdminButton},
};
TabContainer.SetTabTitle(adminVBox, Loc.GetString("permissions-eui-menu-admins-tab-title"));
AdminRanksList = new GridContainer {Columns = 3};
var rankVBox = new VBoxContainer
var rankVBox = new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children = { AdminRanksList, AddAdminRankButton}
};
TabContainer.SetTabTitle(rankVBox, Loc.GetString("permissions-eui-menu-admin-ranks-tab-title"));
@@ -451,7 +454,10 @@ namespace Content.Client.Administration.UI
FlagButtons.Add(flag, (inherit, sub, plus));
}
var bottomButtons = new HBoxContainer();
var bottomButtons = new BoxContainer
{
Orientation = LayoutOrientation.Horizontal
};
if (data != null)
{
// show remove button.
@@ -461,17 +467,20 @@ namespace Content.Client.Administration.UI
bottomButtons.AddChild(SaveButton);
Contents.AddChild(new VBoxContainer
Contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
{
new HBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
SeparationOverride = 2,
Children =
{
new VBoxContainer
new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
HorizontalExpand = true,
Children =
{
@@ -541,7 +550,10 @@ namespace Content.Client.Administration.UI
HorizontalAlignment = HAlignment.Right,
HorizontalExpand = true
};
var flagsBox = new VBoxContainer();
var flagsBox = new BoxContainer
{
Orientation = LayoutOrientation.Vertical
};
foreach (var flag in AdminFlagsHelper.AllFlags)
{
@@ -565,7 +577,10 @@ namespace Content.Client.Administration.UI
flagsBox.AddChild(checkBox);
}
var bottomButtons = new HBoxContainer();
var bottomButtons = new BoxContainer
{
Orientation = LayoutOrientation.Horizontal
};
if (data != null)
{
// show remove button.
@@ -575,8 +590,9 @@ namespace Content.Client.Administration.UI
bottomButtons.AddChild(SaveButton);
Contents.AddChild(new VBoxContainer
Contents.AddChild(new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
Children =
{
NameEdit,

View File

@@ -1,15 +1,15 @@
<SS14Window
xmlns="https://spacestation14.io">
<HBoxContainer HorizontalExpand="True">
<VBoxContainer HorizontalExpand="True" SizeFlagsStretchRatio="0.45">
<HBoxContainer HorizontalExpand="True" VerticalExpand="True"
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" SizeFlagsStretchRatio="0.45">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="True"
SizeFlagsStretchRatio="0.1">
<LineEdit Name="SearchBar" PlaceHolder="Search" HorizontalExpand="True"
SizeFlagsStretchRatio="0.6" />
</HBoxContainer>
</BoxContainer>
<ItemList Name="OutfitList" SelectMode="Single" VerticalExpand="True"
SizeFlagsStretchRatio="0.9" />
<Button Name="ConfirmButton" HorizontalExpand="True" />
</VBoxContainer>
</HBoxContainer>
</BoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -5,7 +5,7 @@
xmlns:at="clr-namespace:Content.Client.Administration.UI.Tabs.AdminTab"
Margin="4"
MinSize="50 50">
<VBoxContainer>
<BoxContainer Orientation="Vertical">
<GridContainer Columns="4">
<cc:UICommandButton Command="kick" Text="{Loc Kick}" WindowType="{x:Type at:KickWindow}" />
<cc:UICommandButton Command="ban" Text="{Loc Ban}" WindowType="{x:Type at:BanWindow}" />
@@ -13,5 +13,5 @@
<cc:UICommandButton Command="tpto" Text="{Loc Teleport}" WindowType="{x:Type at:TeleportWindow}" />
<cc:CommandButton Command="permissions" Text="{Loc Permissions Panel}" />
</GridContainer>
</VBoxContainer>
</BoxContainer>
</Control>

View File

@@ -1,23 +1,23 @@
<SS14Window
xmlns="https://spacestation14.io"
Title="{Loc Ban}" MinSize="425 162">
<VBoxContainer>
<HBoxContainer>
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Player}" MinWidth="100" />
<Control MinWidth="50" />
<LineEdit Name="PlayerNameLine" MinWidth="100" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Reason}" MinSize="100 0" />
<Control MinSize="50 0" />
<LineEdit Name="ReasonLine" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Minutes}" MinWidth="100" />
<Control MinWidth="50" />
<LineEdit Name="MinutesLine" MinWidth="100" HorizontalExpand="True" PlaceHolder="{Loc 0 minutes for a permanent ban}" />
</HBoxContainer>
</BoxContainer>
<Control MinWidth="50" />
<Button Name="SubmitButton" Text="{Loc Ban}" />
</VBoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -2,13 +2,13 @@
xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
Title="{Loc Kick}" MinSize="425 272">
<VBoxContainer>
<HBoxContainer>
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Reason}" MinWidth="100" />
<Control MinWidth="50" />
<LineEdit Name="ReasonLine" MinWidth="100" HorizontalExpand="True" />
</HBoxContainer>
</BoxContainer>
<cc:PlayerListControl Name="PlayerList" />
<Button Name="SubmitButton" Text="{Loc Kick}" />
</VBoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -2,8 +2,8 @@
xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
Title="{Loc Teleport}" MinSize="425 230">
<VBoxContainer>
<BoxContainer Orientation="Vertical">
<cc:PlayerListControl Name="PlayerList" />
<Button Name="SubmitButton" Text="{Loc Teleport}" />
</VBoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -1,13 +1,13 @@
<SS14Window
xmlns="https://spacestation14.io" Title="Kick">
<VBoxContainer>
<HBoxContainer>
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Event}" MinSize="100 0" />
<Control MinSize="50 0" />
<OptionButton Name="EventsOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
</BoxContainer>
<Button Name="PauseButton" Text="{Loc Pause}" />
<Button Name="ResumeButton" Text="{Loc Resume}" />
<Button Name="SubmitButton" Text="{Loc Run}" />
</VBoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -1,11 +1,11 @@
<SS14Window
xmlns="https://spacestation14.io" Title="{Loc Add Atmos}">
<VBoxContainer>
<HBoxContainer>
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Grid}" MinSize="100 0" />
<Control MinSize="50 0" />
<OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
</BoxContainer>
<Button Name="SubmitButton" Text="{Loc Add Atmos}" />
</VBoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -1,31 +1,31 @@
<SS14Window
xmlns="https://spacestation14.io" Title="{Loc Add Gas}">
<VBoxContainer>
<HBoxContainer>
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Grid}" MinSize="100 0" />
<Control MinSize="50 0" />
<OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc TileX}" MinSize="100 0" />
<Control MinSize="50 0" />
<SpinBox Name="TileXSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc TileY}" MinSize="100 0" />
<Control MinSize="50 0" />
<SpinBox Name="TileYSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Gas}" MinSize="100 0" />
<Control MinSize="50 0" />
<OptionButton Name="GasOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Amount}" MinSize="100 0" />
<Control MinSize="50 0" />
<SpinBox Name="AmountSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
</BoxContainer>
<Button Name="SubmitButton" Text="{Loc Add Gas}" />
</VBoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -1,21 +1,21 @@
<SS14Window
xmlns="https://spacestation14.io" Title="{Loc Fill Gas}">
<VBoxContainer>
<HBoxContainer>
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Grid}" MinSize="100 0" />
<Control MinSize="50 0" />
<OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Gas}" MinSize="100 0" />
<Control MinSize="50 0" />
<OptionButton Name="GasOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Amount}" MinSize="100 0" />
<Control MinSize="50 0" />
<SpinBox Name="AmountSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
</BoxContainer>
<Button Name="SubmitButton" Text="{Loc Fill Gas}" />
</VBoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -1,26 +1,26 @@
<SS14Window
xmlns="https://spacestation14.io" Title="{Loc Set Temperature}">
<VBoxContainer>
<HBoxContainer>
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Grid}" MinSize="100 0" />
<Control MinSize="50 0" />
<OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc TileX}" MinSize="100 0" />
<Control MinSize="50 0" />
<SpinBox Name="TileXSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc TileY}" MinSize="100 0" />
<Control MinSize="50 0" />
<SpinBox Name="TileYSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
<HBoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Temperature}" MinSize="100 0" />
<Control MinSize="50 0" />
<SpinBox Name="TemperatureSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer>
</BoxContainer>
<Button Name="SubmitButton" Text="{Loc Set Temperature}" />
</VBoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -1,14 +1,14 @@
<Control xmlns="https://spacestation14.io">
<VBoxContainer>
<HBoxContainer>
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Name="PlayerCount" HorizontalExpand="True" SizeFlagsStretchRatio="0.7"
Text="{Loc Player Count}" />
<Button Name="RefreshButton" HorizontalExpand="True" SizeFlagsStretchRatio="0.3"
Text="{Loc Refresh}" />
</HBoxContainer>
</BoxContainer>
<Control MinSize="0 5" />
<ScrollContainer HorizontalExpand="True" VerticalExpand="True">
<VBoxContainer Name="PlayerList" />
<BoxContainer Orientation="Vertical" Name="PlayerList" />
</ScrollContainer>
</VBoxContainer>
</BoxContainer>
</Control>

View File

@@ -9,6 +9,7 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Administration.UI.Tabs
{
@@ -40,8 +41,9 @@ namespace Content.Client.Administration.UI.Tabs
var altColor = Color.FromHex("#292B38");
var defaultColor = Color.FromHex("#2F2F3B");
var header = new HBoxContainer
var header = new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
HorizontalExpand = true,
SeparationOverride = 4,
Children =
@@ -84,8 +86,9 @@ namespace Content.Client.Administration.UI.Tabs
var useAltColor = false;
foreach (var player in players)
{
var hBox = new HBoxContainer
var hBox = new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
HorizontalExpand = true,
SeparationOverride = 4,
Children =