Replace most VBox/HBoxContainers with BoxContainers (#4274)
This commit is contained in:
@@ -16,6 +16,7 @@ using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Prototypes;
|
||||
using static Content.Shared.Inventory.EquipmentSlotDefines;
|
||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||
|
||||
namespace Content.Client.Lobby.UI
|
||||
{
|
||||
@@ -24,7 +25,7 @@ namespace Content.Client.Lobby.UI
|
||||
private readonly IClientPreferencesManager _preferencesManager;
|
||||
private IEntity _previewDummy;
|
||||
private readonly Label _summaryLabel;
|
||||
private readonly VBoxContainer _loaded;
|
||||
private readonly BoxContainer _loaded;
|
||||
private readonly Label _unloaded;
|
||||
|
||||
public LobbyCharacterPreviewPanel(IEntityManager entityManager,
|
||||
@@ -51,18 +52,28 @@ namespace Content.Client.Lobby.UI
|
||||
var viewWest = MakeSpriteView(_previewDummy, Direction.West);
|
||||
var viewEast = MakeSpriteView(_previewDummy, Direction.East);
|
||||
|
||||
var vBox = new VBoxContainer();
|
||||
var vBox = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical
|
||||
};
|
||||
|
||||
vBox.AddChild(header);
|
||||
|
||||
_unloaded = new Label {Text = Loc.GetString("lobby-character-preview-panel-unloaded-preferences-label")};
|
||||
|
||||
_loaded = new VBoxContainer {Visible = false};
|
||||
_loaded = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
Visible = false
|
||||
};
|
||||
|
||||
_loaded.AddChild(CharacterSetupButton);
|
||||
_loaded.AddChild(_summaryLabel);
|
||||
|
||||
var hBox = new HBoxContainer();
|
||||
var hBox = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Horizontal
|
||||
};
|
||||
hBox.AddChild(viewSouth);
|
||||
hBox.AddChild(viewNorth);
|
||||
hBox.AddChild(viewWest);
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
<MarginContainer MarginBottomOverride="20" MarginLeftOverride="20" MarginRightOverride="20"
|
||||
MarginTopOverride="20">
|
||||
<PanelContainer StyleClasses="AngleRect" />
|
||||
<VBoxContainer>
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<!-- Top row -->
|
||||
<HBoxContainer MinSize="0 40">
|
||||
<BoxContainer Orientation="Horizontal" MinSize="0 40">
|
||||
<MarginContainer MarginLeftOverride="8">
|
||||
<Label StyleClasses="LabelHeadingBigger" VAlign="Center" Text="{Loc 'Lobby'}" />
|
||||
</MarginContainer>
|
||||
@@ -28,7 +28,7 @@
|
||||
<ui:VoteCallMenuButton Name="CCallVoteButton" StyleClasses="ButtonBig" />
|
||||
<Button Name="COptionsButton" StyleClasses="ButtonBig" Text="{Loc 'Options'}" />
|
||||
<Button Name="CLeaveButton" StyleClasses="ButtonBig" Text="{Loc 'Leave'}" />
|
||||
</HBoxContainer>
|
||||
</BoxContainer>
|
||||
<!-- Gold line -->
|
||||
<PanelContainer>
|
||||
<PanelContainer.PanelOverride>
|
||||
@@ -37,20 +37,20 @@
|
||||
</PanelContainer.PanelOverride>
|
||||
</PanelContainer>
|
||||
<!-- Middle section with the two vertical panels -->
|
||||
<HBoxContainer VerticalExpand="True">
|
||||
<BoxContainer Orientation="Horizontal" VerticalExpand="True">
|
||||
<!-- Left panel -->
|
||||
<VBoxContainer Name="CLeftPanelContainer" HorizontalExpand="True">
|
||||
<BoxContainer Orientation="Vertical" Name="CLeftPanelContainer" HorizontalExpand="True">
|
||||
<hudUi:StripeBack>
|
||||
<MarginContainer MarginLeftOverride="3" MarginRightOverride="3" MarginBottomOverride="3"
|
||||
MarginTopOverride="3">
|
||||
<HBoxContainer SeparationOverride="6">
|
||||
<BoxContainer Orientation="Horizontal" SeparationOverride="6">
|
||||
<Button Name="CObserveButton" Text="{Loc 'Observe'}" StyleClasses="ButtonBig" />
|
||||
<Label Name="CStartTime" Align="Right"
|
||||
FontColorOverride="{x:Static maths:Color.DarkGray}"
|
||||
StyleClasses="LabelBig" HorizontalExpand="True" />
|
||||
<Button Name="CReadyButton" ToggleMode="True" Text="{Loc 'Ready Up'}"
|
||||
StyleClasses="ButtonBig" />
|
||||
</HBoxContainer>
|
||||
</BoxContainer>
|
||||
</MarginContainer>
|
||||
</hudUi:StripeBack>
|
||||
<MarginContainer VerticalExpand="True" MarginLeftOverride="3" MarginRightOverride="3"
|
||||
@@ -58,7 +58,7 @@
|
||||
MarginTopOverride="3">
|
||||
<chatUi:ChatBox Name="CChat" />
|
||||
</MarginContainer>
|
||||
</VBoxContainer>
|
||||
</BoxContainer>
|
||||
<!-- Gold line -->
|
||||
<PanelContainer MinSize="2 0">
|
||||
<PanelContainer.PanelOverride>
|
||||
@@ -67,7 +67,7 @@
|
||||
</PanelContainer>
|
||||
<!-- Right panel -->
|
||||
<Control HorizontalExpand="True">
|
||||
<VBoxContainer>
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<!-- Player list -->
|
||||
<hudUi:NanoHeading Text="{Loc 'Online Players'}" />
|
||||
<MarginContainer VerticalExpand="True"
|
||||
@@ -84,13 +84,13 @@
|
||||
MarginBottomOverride="2" MarginTopOverride="3">
|
||||
<info:ServerInfo Name="CServerInfo" />
|
||||
</MarginContainer>
|
||||
</VBoxContainer>
|
||||
</BoxContainer>
|
||||
<MarginContainer SizeFlagsHorizontal="ShrinkEnd" MarginTopOverride="8" MarginRightOverride="8">
|
||||
<VBoxContainer Name="CVoteContainer" />
|
||||
<BoxContainer Orientation="Vertical" Name="CVoteContainer" />
|
||||
</MarginContainer>
|
||||
</Control>
|
||||
</HBoxContainer>
|
||||
</VBoxContainer>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</MarginContainer>
|
||||
|
||||
</Control>
|
||||
|
||||
@@ -8,6 +8,7 @@ using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Maths;
|
||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||
|
||||
namespace Content.Client.Lobby.UI
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace Content.Client.Lobby.UI
|
||||
public Button OptionsButton => COptionsButton;
|
||||
public Button LeaveButton => CLeaveButton;
|
||||
public ChatBox Chat => CChat;
|
||||
public VBoxContainer VoteContainer => CVoteContainer;
|
||||
public BoxContainer VoteContainer => CVoteContainer;
|
||||
public LobbyPlayerList OnlinePlayerList => COnlinePlayerList;
|
||||
public ServerInfo ServerInfo => CServerInfo;
|
||||
public LobbyCharacterPreviewPanel CharacterPreview { get; }
|
||||
@@ -49,7 +50,7 @@ namespace Content.Client.Lobby.UI
|
||||
public class LobbyPlayerList : Control
|
||||
{
|
||||
private readonly ScrollContainer _scroll;
|
||||
private readonly VBoxContainer _vBox;
|
||||
private readonly BoxContainer _vBox;
|
||||
|
||||
public LobbyPlayerList()
|
||||
{
|
||||
@@ -57,7 +58,10 @@ namespace Content.Client.Lobby.UI
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#202028")},
|
||||
};
|
||||
_vBox = new VBoxContainer();
|
||||
_vBox = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical
|
||||
};
|
||||
_scroll = new ScrollContainer();
|
||||
_scroll.AddChild(_vBox);
|
||||
panel.AddChild(_scroll);
|
||||
@@ -67,8 +71,9 @@ namespace Content.Client.Lobby.UI
|
||||
// Adds a row
|
||||
public void AddItem(string name, string status)
|
||||
{
|
||||
var hbox = new HBoxContainer
|
||||
var hbox = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Horizontal,
|
||||
HorizontalExpand = true,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user