From bf493c39b739a485a90cd130cfe35a279684421d Mon Sep 17 00:00:00 2001 From: Visne <39844191+Visne@users.noreply.github.com> Date: Sun, 18 Jul 2021 18:39:31 +0200 Subject: [PATCH] Replace most VBox/HBoxContainers with BoxContainers (#4274) --- Content.Client/AI/ClientAiDebugSystem.cs | 4 +- Content.Client/AME/UI/AMEWindow.cs | 25 ++-- .../Access/UI/IdCardConsoleWindow.cs | 6 +- .../Actions/UI/ActionAlertTooltip.cs | 9 +- Content.Client/Actions/UI/ActionMenu.cs | 7 +- Content.Client/Actions/UI/ActionSlot.cs | 7 +- Content.Client/Actions/UI/ActionsUI.cs | 12 +- .../Administration/UI/AdminAddReagentUI.cs | 7 +- .../UI/CustomControls/PlayerListControl.xaml | 8 +- .../Administration/UI/PermissionsEui.cs | 34 ++++-- .../UI/SetOutfit/SetOutfitMenu.xaml | 12 +- .../UI/Tabs/AdminTab/AdminTab.xaml | 4 +- .../UI/Tabs/AdminTab/BanWindow.xaml | 16 +-- .../UI/Tabs/AdminTab/KickWindow.xaml | 8 +- .../UI/Tabs/AdminTab/TeleportWindow.xaml | 4 +- .../Tabs/AdminbusTab/StationEventsWindow.xaml | 8 +- .../UI/Tabs/AtmosTab/AddAtmosWindow.xaml | 8 +- .../UI/Tabs/AtmosTab/AddGasWindow.xaml | 24 ++-- .../UI/Tabs/AtmosTab/FillGasWindow.xaml | 16 +-- .../Tabs/AtmosTab/SetTemperatureWindow.xaml | 20 ++-- .../Administration/UI/Tabs/PlayerTab.xaml | 10 +- .../Administration/UI/Tabs/PlayerTab.xaml.cs | 7 +- Content.Client/Arcade/BlockGameMenu.cs | 27 +++-- Content.Client/Atmos/UI/GasAnalyzerMenu.cs | 31 +++-- .../Atmos/UI/GasCanisterWindow.xaml | 48 ++++---- Content.Client/Body/UI/BodyScannerDisplay.cs | 13 +- Content.Client/Body/UI/SurgeryWindow.cs | 12 +- Content.Client/Cargo/UI/CargoConsoleMenu.cs | 67 ++++++++--- .../Cargo/UI/CargoConsoleOrderMenu.cs | 6 +- Content.Client/Changelog/ChangelogWindow.xaml | 10 +- .../Changelog/ChangelogWindow.xaml.cs | 14 ++- .../MagicMirrorBoundUserInterface.cs | 22 +++- .../Components/CharacterInfoComponent.cs | 24 ++-- .../CharacterInterfaceComponent.cs | 8 +- Content.Client/Chat/UI/ChatBox.cs | 20 ++-- .../Chemistry/UI/ChemMasterWindow.cs | 52 +++++--- .../Chemistry/UI/ReagentDispenserWindow.cs | 24 ++-- .../Cloning/UI/AcceptCloningWindow.cs | 12 +- Content.Client/Cloning/UI/CloningPodWindow.cs | 20 +++- .../UI/CommunicationsConsoleMenu.cs | 15 ++- .../Configurable/UI/ConfigurationMenu.cs | 26 ++-- .../Construction/UI/ConstructionMenu.xaml | 32 ++--- .../ContextMenu/UI/ContextMenuElement.cs | 17 ++- Content.Client/Crayon/UI/CrayonWindow.cs | 6 +- Content.Client/Credits/CreditsWindow.cs | 13 +- .../Disposal/UI/DisposalMailingUnitWindow.cs | 40 +++++-- .../Disposal/UI/DisposalRouterWindow.cs | 7 +- .../Disposal/UI/DisposalTaggerWindow.cs | 7 +- .../Disposal/UI/DisposalUnitWindow.cs | 13 +- Content.Client/EscapeMenu/UI/EscapeMenu.xaml | 4 +- .../EscapeMenu/UI/OptionsMenu.Audio.cs | 19 ++- .../EscapeMenu/UI/OptionsMenu.Graphics.cs | 26 ++-- .../EscapeMenu/UI/OptionsMenu.KeyRebind.cs | 16 ++- Content.Client/Examine/ExamineSystem.cs | 12 +- Content.Client/Ghost/GhostGui.cs | 9 +- .../Ghost/Roles/UI/GhostRolesEntry.xaml | 8 +- .../Ghost/Roles/UI/GhostRolesWindow.xaml | 2 +- .../Ghost/Roles/UI/MakeGhostRoleWindow.xaml | 24 ++-- .../GravityGeneratorBoundUserInterface.cs | 4 +- Content.Client/HUD/GameHud.cs | 42 ++++--- Content.Client/Hands/HandsGui.cs | 15 ++- Content.Client/Info/InfoWindow.cs | 13 +- Content.Client/Info/ServerInfo.cs | 5 +- .../Instruments/UI/InstrumentMenu.xaml | 16 +-- .../HumanInventoryInterfaceController.cs | 10 +- Content.Client/Items/UI/ItemStatusPanel.cs | 11 +- .../Kitchen/UI/MicrowaveBoundUserInterface.cs | 26 ++-- .../UI/ReagentGrinderBoundUserInterface.cs | 11 +- Content.Client/LateJoin/LateJoinGui.cs | 17 ++- Content.Client/Lathe/UI/LatheMenu.cs | 10 +- Content.Client/Lathe/UI/LatheQueueMenu.cs | 14 ++- .../Launcher/LauncherConnectingGui.xaml | 28 ++--- .../Components/HandheldLightComponent.cs | 4 +- .../Lobby/UI/LobbyCharacterPreviewPanel.cs | 19 ++- Content.Client/Lobby/UI/LobbyGui.xaml | 26 ++-- Content.Client/Lobby/UI/LobbyGui.xaml.cs | 13 +- Content.Client/MainMenu/MainMenu.cs | 10 +- .../MedicalScanner/UI/MedicalScannerWindow.cs | 4 +- Content.Client/PDA/PDABoundUserInterface.cs | 31 +++-- Content.Client/Paper/UI/PaperWindow.cs | 6 +- .../UI/ParticleAcceleratorControlMenu.cs | 27 +++-- .../Power/APC/ApcBoundUserInterface.cs | 21 +++- Content.Client/Power/SolarControlWindow.xaml | 4 +- .../Preferences/UI/CharacterSetupGui.cs | 23 +++- .../Preferences/UI/HumanoidProfileEditor.cs | 113 +++++++++++++----- .../Research/UI/ResearchConsoleMenu.cs | 21 ++-- .../RoundEnd/RoundEndSummaryWindow.cs | 16 ++- Content.Client/Sandbox/SandboxManager.cs | 7 +- .../Storage/ClientStorageComponent.cs | 14 ++- Content.Client/Strip/StrippingMenu.cs | 9 +- Content.Client/Suspicion/SuspicionGui.xaml | 4 +- .../Atmos/GasTank/GasTankWindow.cs | 20 +++- Content.Client/Verbs/VerbSystem.cs | 14 ++- Content.Client/Voting/UI/VoteCallMenu.xaml | 12 +- Content.Client/Voting/UI/VotePopup.xaml | 8 +- .../ClientBatteryBarrelComponent.cs | 9 +- .../ClientBoltActionBarrelComponent.cs | 20 +++- .../ClientMagazineBarrelComponent.cs | 9 +- .../Components/ClientPumpBarrelComponent.cs | 20 +++- .../ClientRevolverBarrelComponent.cs | 6 +- Content.Client/Wires/UI/WiresMenu.cs | 36 ++++-- 101 files changed, 1143 insertions(+), 567 deletions(-) diff --git a/Content.Client/AI/ClientAiDebugSystem.cs b/Content.Client/AI/ClientAiDebugSystem.cs index e60014f48f..fb3a657c4b 100644 --- a/Content.Client/AI/ClientAiDebugSystem.cs +++ b/Content.Client/AI/ClientAiDebugSystem.cs @@ -8,6 +8,7 @@ using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using static Robust.Client.UserInterface.Controls.BoxContainer; namespace Content.Client.AI { @@ -169,8 +170,9 @@ namespace Content.Client.AI MouseFilter = Control.MouseFilterMode.Ignore, }; - var vBox = new VBoxContainer() + var vBox = new BoxContainer() { + Orientation = LayoutOrientation.Vertical, SeparationOverride = 15, Children = {actionLabel, pathfindingLabel}, }; diff --git a/Content.Client/AME/UI/AMEWindow.cs b/Content.Client/AME/UI/AMEWindow.cs index 0b56471431..e9104e6f67 100644 --- a/Content.Client/AME/UI/AMEWindow.cs +++ b/Content.Client/AME/UI/AMEWindow.cs @@ -6,6 +6,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; using static Content.Shared.AME.SharedAMEControllerComponent; +using static Robust.Client.UserInterface.Controls.BoxContainer; namespace Content.Client.AME.UI { @@ -30,58 +31,66 @@ namespace Content.Client.AME.UI MinSize = SetSize = (250, 250); - Contents.AddChild(new VBoxContainer + Contents.AddChild(new BoxContainer { + Orientation = LayoutOrientation.Vertical, Children = { - new HBoxContainer + new BoxContainer { + Orientation = LayoutOrientation.Horizontal, Children = { new Label {Text = Loc.GetString("ame-window-engine-status-label") + " "}, (InjectionStatus = new Label {Text = Loc.GetString("ame-window-engine-injection-status-not-injecting-label")}) } }, - new HBoxContainer + new BoxContainer { + Orientation = LayoutOrientation.Horizontal, Children = { (ToggleInjection = new Button {Text = Loc.GetString("ame-window-toggle-injection-button"), StyleClasses = {StyleBase.ButtonOpenBoth}, Disabled = true}), } }, - new HBoxContainer + new BoxContainer { + Orientation = LayoutOrientation.Horizontal, Children = { new Label {Text = Loc.GetString("ame-window-fuel-status-label") + " "}, (FuelAmount = new Label {Text = Loc.GetString("ame-window-fuel-not-inserted-text")}) } }, - new HBoxContainer + new BoxContainer { + Orientation = LayoutOrientation.Horizontal, Children = { (EjectButton = new Button {Text = Loc.GetString("ame-window-eject-button"), StyleClasses = {StyleBase.ButtonOpenBoth}, Disabled = true}), } }, - new HBoxContainer + new BoxContainer { + Orientation = LayoutOrientation.Horizontal, Children = { new Label {Text = Loc.GetString("ame-window-injection-amount-label") + " "}, (InjectionAmount = new Label {Text = "0"}) } }, - new HBoxContainer + new BoxContainer { + Orientation = LayoutOrientation.Horizontal, Children = { (IncreaseFuelButton = new Button {Text = Loc.GetString("ame-window-increase-fuel-button"), StyleClasses = {StyleBase.ButtonOpenRight}}), (DecreaseFuelButton = new Button {Text = Loc.GetString("ame-window-decrease-fuel-button"), StyleClasses = {StyleBase.ButtonOpenLeft}}), } }, - new HBoxContainer + new BoxContainer { + Orientation = LayoutOrientation.Horizontal, Children = { new Label { Text = Loc.GetString("ame-window-core-count-label") + " "}, diff --git a/Content.Client/Access/UI/IdCardConsoleWindow.cs b/Content.Client/Access/UI/IdCardConsoleWindow.cs index 450aa0ebdd..4c3093baa2 100644 --- a/Content.Client/Access/UI/IdCardConsoleWindow.cs +++ b/Content.Client/Access/UI/IdCardConsoleWindow.cs @@ -8,6 +8,7 @@ using Robust.Shared.Localization; using Robust.Shared.Maths; using Robust.Shared.Prototypes; using static Content.Shared.Access.SharedIdCardConsoleComponent; +using static Robust.Client.UserInterface.Controls.BoxContainer; namespace Content.Client.Access.UI { @@ -38,7 +39,10 @@ namespace Content.Client.Access.UI { MinSize = SetSize = (650, 290); _owner = owner; - var vBox = new VBoxContainer(); + var vBox = new BoxContainer + { + Orientation = LayoutOrientation.Vertical + }; vBox.AddChild(new GridContainer { diff --git a/Content.Client/Actions/UI/ActionAlertTooltip.cs b/Content.Client/Actions/UI/ActionAlertTooltip.cs index 8ebb9c8642..b64faa56b1 100644 --- a/Content.Client/Actions/UI/ActionAlertTooltip.cs +++ b/Content.Client/Actions/UI/ActionAlertTooltip.cs @@ -4,6 +4,7 @@ using Robust.Client.UserInterface.Controls; using Robust.Shared.IoC; using Robust.Shared.Timing; using Robust.Shared.Utility; +using static Robust.Client.UserInterface.Controls.BoxContainer; namespace Content.Client.Actions.UI { @@ -28,8 +29,12 @@ namespace Content.Client.Actions.UI SetOnlyStyleClass(StyleNano.StyleClassTooltipPanel); - VBoxContainer vbox; - AddChild(vbox = new VBoxContainer {RectClipContent = true}); + BoxContainer vbox; + AddChild(vbox = new BoxContainer + { + Orientation = LayoutOrientation.Vertical, + RectClipContent = true + }); var nameLabel = new RichTextLabel { MaxWidth = TooltipTextMaxWidth, diff --git a/Content.Client/Actions/UI/ActionMenu.cs b/Content.Client/Actions/UI/ActionMenu.cs index f935adfd3c..bb7f996ad0 100644 --- a/Content.Client/Actions/UI/ActionMenu.cs +++ b/Content.Client/Actions/UI/ActionMenu.cs @@ -19,6 +19,7 @@ using Robust.Shared.Localization; using Robust.Shared.Log; using Robust.Shared.Timing; using static Robust.Client.UserInterface.Controls.BaseButton; +using static Robust.Client.UserInterface.Controls.BoxContainer; namespace Content.Client.Actions.UI { @@ -71,12 +72,14 @@ namespace Content.Client.Actions.UI Title = Loc.GetString("ui-actionmenu-title"); MinSize = (300, 300); - Contents.AddChild(new VBoxContainer + Contents.AddChild(new BoxContainer { + Orientation = LayoutOrientation.Vertical, Children = { - new HBoxContainer + new BoxContainer { + Orientation = LayoutOrientation.Horizontal, Children = { (_searchBar = new LineEdit diff --git a/Content.Client/Actions/UI/ActionSlot.cs b/Content.Client/Actions/UI/ActionSlot.cs index 29b4b48b82..36702eddd9 100644 --- a/Content.Client/Actions/UI/ActionSlot.cs +++ b/Content.Client/Actions/UI/ActionSlot.cs @@ -16,6 +16,7 @@ using Robust.Shared.Localization; using Robust.Shared.Maths; using Robust.Shared.Timing; using Robust.Shared.Utility; +using static Robust.Client.UserInterface.Controls.BoxContainer; namespace Content.Client.Actions.UI { @@ -174,8 +175,9 @@ namespace Content.Client.Actions.UI _cooldownGraphic = new CooldownGraphic {Progress = 0, Visible = false}; // padding to the left of the number to shift it right - var paddingBox = new HBoxContainer() + var paddingBox = new BoxContainer { + Orientation = LayoutOrientation.Horizontal, HorizontalExpand = true, VerticalExpand = true, MinSize = (64, 64) @@ -187,8 +189,9 @@ namespace Content.Client.Actions.UI paddingBox.AddChild(_number); // padding to the left of the small icon - var paddingBoxItemIcon = new HBoxContainer() + var paddingBoxItemIcon = new BoxContainer { + Orientation = LayoutOrientation.Horizontal, HorizontalExpand = true, VerticalExpand = true, MinSize = (64, 64) diff --git a/Content.Client/Actions/UI/ActionsUI.cs b/Content.Client/Actions/UI/ActionsUI.cs index 7c9b5ca86b..7544bece52 100644 --- a/Content.Client/Actions/UI/ActionsUI.cs +++ b/Content.Client/Actions/UI/ActionsUI.cs @@ -18,6 +18,7 @@ using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Log; using Robust.Shared.Timing; +using static Robust.Client.UserInterface.Controls.BoxContainer; namespace Content.Client.Actions.UI { @@ -42,7 +43,7 @@ namespace Content.Client.Actions.UI private readonly Label _loadoutNumber; private readonly Texture _lockTexture; private readonly Texture _unlockTexture; - private readonly HBoxContainer _loadoutContainer; + private readonly BoxContainer _loadoutContainer; private readonly TextureRect _dragShadow; @@ -108,15 +109,17 @@ namespace Content.Client.Actions.UI }; AddChild(panelContainer); - var hotbarContainer = new VBoxContainer + var hotbarContainer = new BoxContainer { + Orientation = LayoutOrientation.Vertical, SeparationOverride = 3, HorizontalAlignment = HAlignment.Left }; panelContainer.AddChild(hotbarContainer); - var settingsContainer = new HBoxContainer + var settingsContainer = new BoxContainer { + Orientation = LayoutOrientation.Horizontal, HorizontalExpand = true }; hotbarContainer.AddChild(settingsContainer); @@ -156,8 +159,9 @@ namespace Content.Client.Actions.UI }; hotbarContainer.AddChild(_slotContainer); - _loadoutContainer = new HBoxContainer + _loadoutContainer = new BoxContainer { + Orientation = LayoutOrientation.Horizontal, HorizontalExpand = true, MouseFilter = MouseFilterMode.Stop }; diff --git a/Content.Client/Administration/UI/AdminAddReagentUI.cs b/Content.Client/Administration/UI/AdminAddReagentUI.cs index 397b899369..425fb16746 100644 --- a/Content.Client/Administration/UI/AdminAddReagentUI.cs +++ b/Content.Client/Administration/UI/AdminAddReagentUI.cs @@ -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 diff --git a/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml b/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml index 33d5d6d535..4f64435d42 100644 --- a/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml +++ b/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml @@ -1,13 +1,13 @@ - - + - + - + diff --git a/Content.Client/Administration/UI/PermissionsEui.cs b/Content.Client/Administration/UI/PermissionsEui.cs index feaa2b751d..8aa8b32a6f 100644 --- a/Content.Client/Administration/UI/PermissionsEui.cs +++ b/Content.Client/Administration/UI/PermissionsEui.cs @@ -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, diff --git a/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml b/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml index 6cdafeb1c8..efb831cd1b 100644 --- a/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml +++ b/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml @@ -1,15 +1,15 @@ - - - + + - +