From b898443f288e5b805b3d475f923fac46fcb91504 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sun, 21 Feb 2021 12:38:56 +0100 Subject: [PATCH] WPF layout (#3346) --- Content.Client/Arcade/BlockGameMenu.cs | 88 +++--- .../Arcade/SpaceVillainArcadeMenu.cs | 2 +- Content.Client/Chat/ChatBox.cs | 27 +- Content.Client/Chat/SpeechBubble.cs | 10 +- Content.Client/ClientNotifyManager.cs | 5 +- .../Command/CommunicationsConsoleMenu.cs | 13 +- .../Construction/ConstructionMenu.xaml | 38 +-- .../Construction/ConstructionMenu.xaml.cs | 7 +- .../Components/Access/IdCardConsoleWindow.cs | 13 +- .../Actor/CharacterInfoComponent.cs | 10 +- .../Components/Atmos/GasAnalyzerMenu.cs | 106 +++---- .../Components/Atmos/GasCanisterWindow.cs | 5 +- .../Body/Scanner/BodyScannerDisplay.cs | 13 +- .../Components/Body/Surgery/SurgeryWindow.cs | 19 +- .../Chemistry/ChemMaster/ChemMasterWindow.cs | 41 ++- .../ReagentDispenserWindow.cs | 15 +- .../Components/CloningPod/CloningPodWindow.cs | 289 +++--------------- .../Configuration/ConfigurationMenu.cs | 67 ++-- .../Components/Crayon/CrayonWindow.cs | 7 +- .../Disposal/DisposalMailingUnitWindow.cs | 272 ++++++++--------- .../Disposal/DisposalRouterWindow.cs | 16 +- .../Disposal/DisposalTaggerWindow.cs | 15 +- .../Components/Disposal/DisposalUnitWindow.cs | 16 +- .../GravityGeneratorBoundUserInterface.cs | 4 +- .../HumanInventoryInterfaceController.cs | 4 +- .../Components/HandheldLightComponent.cs | 4 +- .../Kitchen/MicrowaveBoundUserInterface.cs | 48 ++- .../ReagentGrinderBoundUserInterface.cs | 34 +-- .../MagicMirrorBoundUserInterface.cs | 17 +- .../MedicalScanner/MedicalScannerWindow.cs | 4 +- .../Observer/AcceptCloningWindow.cs | 2 +- .../Observer/GhostRoles/GhostRolesEntry.xaml | 2 +- .../Observer/GhostRoles/GhostRolesWindow.xaml | 8 +- .../GhostRoles/GhostRolesWindow.xaml.cs | 2 - .../GhostRoles/MakeGhostRoleWindow.xaml | 4 +- .../GhostRoles/MakeGhostRoleWindow.xaml.cs | 12 +- .../Components/PDA/PDABoundUserInterface.cs | 51 ++-- .../Components/Paper/PaperWindow.cs | 2 +- .../Components/Power/ApcBoundUserInterface.cs | 2 +- .../SolarControlConsoleBoundUserInterface.cs | 14 +- .../ResearchClientServerSelectionMenu.cs | 16 +- .../Storage/ClientStorageComponent.cs | 33 +- .../Barrels/ClientBatteryBarrelComponent.cs | 24 +- .../ClientBoltActionBarrelComponent.cs | 24 +- .../Barrels/ClientMagazineBarrelComponent.cs | 30 +- .../Barrels/ClientPumpBarrelComponent.cs | 24 +- .../Barrels/ClientRevolverBarrelComponent.cs | 18 +- .../GameObjects/Components/Wires/WiresMenu.cs | 141 ++++----- .../EntitySystems/DoAfter/DoAfterGui.cs | 4 +- .../EntitySystems/ExamineSystem.cs | 5 +- .../HealthOverlay/HealthOverlayGui.cs | 6 +- .../GameObjects/EntitySystems/VerbSystem.cs | 32 +- .../Instruments/InstrumentMenu.xaml | 51 ++-- .../Instruments/InstrumentMenu.xaml.cs | 22 +- Content.Client/Research/LatheMenu.cs | 36 +-- Content.Client/Research/LatheQueueMenu.cs | 52 +--- .../Research/ResearchConsoleMenu.cs | 44 +-- Content.Client/State/LauncherConnecting.cs | 195 ++++++------ Content.Client/State/MainMenu.cs | 8 +- Content.Client/UserInterface/ActionMenu.cs | 20 +- .../UserInterface/ActionMenuItem.cs | 8 +- Content.Client/UserInterface/ActionsUI.cs | 68 ++--- .../UserInterface/AdminAddReagentUI.cs | 8 +- .../AdminMenu/AdminMenuWindow.xaml.cs | 3 +- .../AdminMenu/SetOutfit/SetOutfitMenu.xaml | 12 +- .../AdminMenu/SetOutfit/SetOutfitMenu.xaml.cs | 3 +- .../AdminMenu/Tabs/AdminTab/AdminTab.xaml | 10 +- .../AdminMenu/Tabs/AdminTab/AdminTab.xaml.cs | 4 +- .../AdminMenu/Tabs/AdminTab/BanWindow.xaml | 22 +- .../AdminMenu/Tabs/AdminTab/KickWindow.xaml | 8 +- .../Tabs/AdminTab/TeleportWindow.xaml | 4 +- .../Tabs/AdminbusTab/AdminbusTab.xaml | 10 +- .../Tabs/AdminbusTab/AdminbusTab.xaml.cs | 3 +- .../Tabs/AdminbusTab/StationEventsWindow.xaml | 6 +- .../Tabs/AtmosTab/AddAtmosWindow.xaml | 6 +- .../AdminMenu/Tabs/AtmosTab/AddGasWindow.xaml | 30 +- .../AdminMenu/Tabs/AtmosTab/AtmosTab.xaml | 10 +- .../AdminMenu/Tabs/AtmosTab/AtmosTab.xaml.cs | 3 +- .../Tabs/AtmosTab/FillGasWindow.xaml | 18 +- .../Tabs/AtmosTab/SetTemperatureWindow.xaml | 24 +- .../AdminMenu/Tabs/PlayerTab.xaml | 17 +- .../AdminMenu/Tabs/PlayerTab.xaml.cs | 16 +- .../AdminMenu/Tabs/RoundTab.xaml | 10 +- .../AdminMenu/Tabs/RoundTab.xaml.cs | 3 +- .../AdminMenu/Tabs/ServerTab.xaml | 10 +- .../AdminMenu/Tabs/ServerTab.xaml.cs | 6 +- Content.Client/UserInterface/AlertsUI.cs | 21 +- .../Atmos/GasTank/GasTankWindow.cs | 97 ++---- .../UserInterface/Cargo/CargoConsoleMenu.cs | 55 ++-- .../Cargo/CargoConsoleOrderMenu.cs | 2 +- .../Cargo/GalacticBankSelectionMenu.cs | 13 +- .../UserInterface/CharacterSetupGui.cs | 55 ++-- .../UserInterface/Controls/ActionSlot.cs | 38 ++- Content.Client/UserInterface/CreditsWindow.cs | 52 ++-- Content.Client/UserInterface/GameHud.cs | 46 +-- Content.Client/UserInterface/GhostGui.cs | 30 +- .../UserInterface/HumanoidProfileEditor.cs | 77 ++--- .../UserInterface/ItemSlotButton.cs | 12 +- .../UserInterface/ItemStatusPanel.cs | 11 +- Content.Client/UserInterface/LateJoinGui.cs | 9 +- .../LobbyCharacterPreviewPanel.cs | 2 +- Content.Client/UserInterface/LobbyGui.xaml | 22 +- Content.Client/UserInterface/LobbyGui.xaml.cs | 11 +- Content.Client/UserInterface/NanoHeading.cs | 12 +- .../UserInterface/OptionsMenu.Audio.cs | 43 ++- .../UserInterface/OptionsMenu.Graphics.cs | 28 +- .../UserInterface/OptionsMenu.KeyRebind.cs | 36 +-- Content.Client/UserInterface/OptionsMenu.cs | 3 +- .../ParticleAcceleratorControlMenu.cs | 259 +++++++--------- .../Permissions/PermissionsEui.cs | 30 +- Content.Client/UserInterface/Placeholder.cs | 3 +- .../UserInterface/RoundEndSummaryWindow.cs | 23 +- Content.Client/UserInterface/ServerInfo.cs | 2 +- Content.Client/UserInterface/StripeBack.cs | 47 +-- Content.Client/UserInterface/StrippingMenu.cs | 9 +- .../Suspicion/SuspicionGui.xaml.cs | 2 +- Content.Client/UserInterface/TargetingDoll.cs | 6 +- .../UserInterface/TutorialWindow.cs | 3 +- .../VendingMachines/VendingMachineMenu.cs | 5 +- Content.Client/Voting/VoteCallMenu.xaml | 8 +- Content.Client/Voting/VotePopup.xaml | 2 +- 121 files changed, 1420 insertions(+), 2069 deletions(-) diff --git a/Content.Client/Arcade/BlockGameMenu.cs b/Content.Client/Arcade/BlockGameMenu.cs index d2ae617356..c55d27e0cb 100644 --- a/Content.Client/Arcade/BlockGameMenu.cs +++ b/Content.Client/Arcade/BlockGameMenu.cs @@ -90,8 +90,8 @@ namespace Content.Client.Arcade _highscoresRootContainer = new PanelContainer { PanelOverride = rootBack, - SizeFlagsVertical = SizeFlags.ShrinkCenter, - SizeFlagsHorizontal = SizeFlags.ShrinkCenter + VerticalAlignment = VAlignment.Center, + HorizontalAlignment = HAlignment.Center }; var c = new Color(OverlayBackgroundColor.R,OverlayBackgroundColor.G,OverlayBackgroundColor.B,220); @@ -104,20 +104,20 @@ namespace Content.Client.Arcade var menuInnerPanel = new PanelContainer { PanelOverride = innerBack, - SizeFlagsVertical = SizeFlags.ShrinkCenter, - SizeFlagsHorizontal = SizeFlags.ShrinkCenter + VerticalAlignment = VAlignment.Center, + HorizontalAlignment = HAlignment.Center }; _highscoresRootContainer.AddChild(menuInnerPanel); var menuContainer = new VBoxContainer() { - SizeFlagsHorizontal = SizeFlags.ShrinkCenter, - SizeFlagsVertical = SizeFlags.ShrinkCenter + HorizontalAlignment = HAlignment.Center, + VerticalAlignment = VAlignment.Center }; menuContainer.AddChild(new Label{Text = Loc.GetString("Highscores")}); - menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); + menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)}); var highScoreBox = new HBoxContainer(); @@ -126,14 +126,14 @@ namespace Content.Client.Arcade Align = Label.AlignMode.Center }; highScoreBox.AddChild(_localHighscoresLabel); - highScoreBox.AddChild(new Control{CustomMinimumSize = new Vector2(40,1)}); + highScoreBox.AddChild(new Control{MinSize = new Vector2(40,1)}); _globalHighscoresLabel = new Label { Align = Label.AlignMode.Center }; highScoreBox.AddChild(_globalHighscoresLabel); menuContainer.AddChild(highScoreBox); - menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); + menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)}); _highscoreBackButton = new Button { Text = Loc.GetString("Back"), @@ -156,8 +156,8 @@ namespace Content.Client.Arcade _gameOverRootContainer = new PanelContainer { PanelOverride = rootBack, - SizeFlagsVertical = SizeFlags.ShrinkCenter, - SizeFlagsHorizontal = SizeFlags.ShrinkCenter + VerticalAlignment = VAlignment.Center, + HorizontalAlignment = HAlignment.Center }; var innerBack = new StyleBoxTexture @@ -169,25 +169,25 @@ namespace Content.Client.Arcade var menuInnerPanel = new PanelContainer { PanelOverride = innerBack, - SizeFlagsVertical = SizeFlags.ShrinkCenter, - SizeFlagsHorizontal = SizeFlags.ShrinkCenter + VerticalAlignment = VAlignment.Center, + HorizontalAlignment = HAlignment.Center }; _gameOverRootContainer.AddChild(menuInnerPanel); var menuContainer = new VBoxContainer { - SizeFlagsHorizontal = SizeFlags.ShrinkCenter, - SizeFlagsVertical = SizeFlags.ShrinkCenter + HorizontalAlignment = HAlignment.Center, + VerticalAlignment = VAlignment.Center }; menuContainer.AddChild(new Label{Text = Loc.GetString("Gameover!"),Align = Label.AlignMode.Center}); - menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); + menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)}); _finalScoreLabel = new Label{Align = Label.AlignMode.Center}; menuContainer.AddChild(_finalScoreLabel); - menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); + menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)}); _finalNewGameButton = new Button { @@ -214,8 +214,8 @@ namespace Content.Client.Arcade _menuRootContainer = new PanelContainer { PanelOverride = rootBack, - SizeFlagsVertical = SizeFlags.ShrinkCenter, - SizeFlagsHorizontal = SizeFlags.ShrinkCenter + VerticalAlignment = VAlignment.Center, + HorizontalAlignment = HAlignment.Center }; var innerBack = new StyleBoxTexture @@ -227,8 +227,8 @@ namespace Content.Client.Arcade var menuInnerPanel = new PanelContainer { PanelOverride = innerBack, - SizeFlagsVertical = SizeFlags.ShrinkCenter, - SizeFlagsHorizontal = SizeFlags.ShrinkCenter + VerticalAlignment = VAlignment.Center, + HorizontalAlignment = HAlignment.Center }; _menuRootContainer.AddChild(menuInnerPanel); @@ -236,8 +236,8 @@ namespace Content.Client.Arcade var menuContainer = new VBoxContainer { - SizeFlagsHorizontal = SizeFlags.ShrinkCenter, - SizeFlagsVertical = SizeFlags.ShrinkCenter + HorizontalAlignment = HAlignment.Center, + VerticalAlignment = VAlignment.Center }; _newGameButton = new Button @@ -250,7 +250,7 @@ namespace Content.Client.Arcade _owner.SendAction(BlockGamePlayerAction.NewGame); }; menuContainer.AddChild(_newGameButton); - menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); + menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)}); _scoreBoardButton = new Button { @@ -259,7 +259,7 @@ namespace Content.Client.Arcade }; _scoreBoardButton.OnPressed += (e) => _owner.SendAction(BlockGamePlayerAction.ShowHighscores); menuContainer.AddChild(_scoreBoardButton); - _unpauseButtonMargin = new Control {CustomMinimumSize = new Vector2(1, 10), Visible = false}; + _unpauseButtonMargin = new Control {MinSize = new Vector2(1, 10), Visible = false}; menuContainer.AddChild(_unpauseButtonMargin); _unpauseButton = new Button @@ -301,35 +301,35 @@ namespace Content.Client.Arcade _levelLabel = new Label { Align = Label.AlignMode.Center, - SizeFlagsHorizontal = SizeFlags.FillExpand + HorizontalExpand = true }; _gameRootContainer.AddChild(_levelLabel); _gameRootContainer.AddChild(new Control { - CustomMinimumSize = new Vector2(1,5) + MinSize = new Vector2(1,5) }); _pointsLabel = new Label { Align = Label.AlignMode.Center, - SizeFlagsHorizontal = SizeFlags.FillExpand + HorizontalExpand = true }; _gameRootContainer.AddChild(_pointsLabel); _gameRootContainer.AddChild(new Control { - CustomMinimumSize = new Vector2(1,10) + MinSize = new Vector2(1,10) }); var gameBox = new HBoxContainer(); gameBox.AddChild(SetupHoldBox(backgroundTexture)); gameBox.AddChild(new Control { - CustomMinimumSize = new Vector2(10,1) + MinSize = new Vector2(10,1) }); gameBox.AddChild(SetupGameGrid(backgroundTexture)); gameBox.AddChild(new Control { - CustomMinimumSize = new Vector2(10,1) + MinSize = new Vector2(10,1) }); gameBox.AddChild(SetupNextBox(backgroundTexture)); @@ -337,7 +337,7 @@ namespace Content.Client.Arcade _gameRootContainer.AddChild(new Control { - CustomMinimumSize = new Vector2(1,10) + MinSize = new Vector2(1,10) }); _pauseButton = new Button @@ -369,7 +369,7 @@ namespace Content.Client.Arcade var gamePanel = new PanelContainer { PanelOverride = back, - SizeFlagsHorizontal = SizeFlags.FillExpand, + HorizontalExpand = true, SizeFlagsStretchRatio = 60 }; var backgroundPanel = new PanelContainer @@ -393,16 +393,16 @@ namespace Content.Client.Arcade var grid = new GridContainer { Columns = 1, - SizeFlagsHorizontal = SizeFlags.FillExpand, + HorizontalExpand = true, SizeFlagsStretchRatio = 20 }; var nextBlockPanel = new PanelContainer { PanelOverride = previewBack, - CustomMinimumSize = BlockSize * 6.5f, - SizeFlagsHorizontal = SizeFlags.None, - SizeFlagsVertical = SizeFlags.None + MinSize = BlockSize * 6.5f, + HorizontalAlignment = HAlignment.Left, + VerticalAlignment = VAlignment.Top }; var nextCenterContainer = new CenterContainer(); _nextBlockGrid = new GridContainer @@ -431,16 +431,16 @@ namespace Content.Client.Arcade var grid = new GridContainer { Columns = 1, - SizeFlagsHorizontal = SizeFlags.FillExpand, + HorizontalExpand = true, SizeFlagsStretchRatio = 20 }; var holdBlockPanel = new PanelContainer { PanelOverride = previewBack, - CustomMinimumSize = BlockSize * 6.5f, - SizeFlagsHorizontal = SizeFlags.None, - SizeFlagsVertical = SizeFlags.None + MinSize = BlockSize * 6.5f, + HorizontalAlignment = HAlignment.Left, + VerticalAlignment = VAlignment.Top }; var holdCenterContainer = new CenterContainer(); _holdBlockGrid = new GridContainer @@ -625,7 +625,7 @@ namespace Content.Client.Arcade _nextBlockGrid.AddChild(new PanelContainer { PanelOverride = new StyleBoxFlat {BackgroundColor = c}, - CustomMinimumSize = BlockSize, + MinSize = BlockSize, RectDrawClipMargin = 0 }); } @@ -647,7 +647,7 @@ namespace Content.Client.Arcade _holdBlockGrid.AddChild(new PanelContainer { PanelOverride = new StyleBoxFlat {BackgroundColor = c}, - CustomMinimumSize = BlockSize, + MinSize = BlockSize, RectDrawClipMargin = 0 }); } @@ -665,7 +665,7 @@ namespace Content.Client.Arcade _gameGrid.AddChild(new PanelContainer { PanelOverride = new StyleBoxFlat {BackgroundColor = c}, - CustomMinimumSize = BlockSize, + MinSize = BlockSize, RectDrawClipMargin = 0 }); } diff --git a/Content.Client/Arcade/SpaceVillainArcadeMenu.cs b/Content.Client/Arcade/SpaceVillainArcadeMenu.cs index e8897e7ebd..588b8f4f8c 100644 --- a/Content.Client/Arcade/SpaceVillainArcadeMenu.cs +++ b/Content.Client/Arcade/SpaceVillainArcadeMenu.cs @@ -9,7 +9,6 @@ namespace Content.Client.Arcade { public class SpaceVillainArcadeMenu : SS14Window { - protected override Vector2? CustomSize => (400, 200); public SpaceVillainArcadeBoundUserInterface Owner { get; set; } private readonly Label _enemyNameLabel; @@ -21,6 +20,7 @@ namespace Content.Client.Arcade private readonly Button[] _gameButtons = new Button[3]; //used to disable/enable all game buttons public SpaceVillainArcadeMenu(SpaceVillainArcadeBoundUserInterface owner) { + MinSize = SetSize = (400, 200); Title = Loc.GetString("Space Villain"); Owner = owner; diff --git a/Content.Client/Chat/ChatBox.cs b/Content.Client/Chat/ChatBox.cs index 0269076663..7c4c650752 100644 --- a/Content.Client/Chat/ChatBox.cs +++ b/Content.Client/Chat/ChatBox.cs @@ -9,7 +9,7 @@ using Robust.Shared.Utility; namespace Content.Client.Chat { - public class ChatBox : MarginContainer + public class ChatBox : Control { public delegate void TextSubmitHandler(ChatBox chatBox, string text); @@ -23,7 +23,7 @@ namespace Content.Client.Chat public Button LocalButton { get; } public Button OOCButton { get; } public Button AdminButton { get; } - public Button DeadButton { get; } + public Button DeadButton { get; } /// /// Default formatting string for the ClientChatConsole. @@ -36,13 +36,6 @@ namespace Content.Client.Chat public ChatBox() { - /*MarginLeft = -475.0f; - MarginTop = 10.0f; - MarginRight = -10.0f; - MarginBottom = 235.0f; - - AnchorLeft = 1.0f; - AnchorRight = 1.0f;*/ MouseFilter = MouseFilterMode.Stop; var outerVBox = new VBoxContainer(); @@ -50,7 +43,7 @@ namespace Content.Client.Chat var panelContainer = new PanelContainer { PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#25252aaa")}, - SizeFlagsVertical = SizeFlags.FillExpand + VerticalExpand = true }; var vBox = new VBoxContainer(); panelContainer.AddChild(vBox); @@ -59,15 +52,8 @@ namespace Content.Client.Chat outerVBox.AddChild(panelContainer); outerVBox.AddChild(hBox); - - var contentMargin = new MarginContainer - { - MarginLeftOverride = 4, MarginRightOverride = 4, - SizeFlagsVertical = SizeFlags.FillExpand - }; - Contents = new OutputPanel(); - contentMargin.AddChild(Contents); - vBox.AddChild(contentMargin); + Contents = new OutputPanel {Margin = new Thickness(4, 0), VerticalExpand = true}; + vBox.AddChild(Contents); Input = new HistoryLineEdit(); Input.OnKeyBindDown += InputKeyBindDown; @@ -78,7 +64,8 @@ namespace Content.Client.Chat { Text = Loc.GetString("All"), Name = "ALL", - SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Expand, + HorizontalExpand = true, + HorizontalAlignment = HAlignment.Right, ToggleMode = true, }; diff --git a/Content.Client/Chat/SpeechBubble.cs b/Content.Client/Chat/SpeechBubble.cs index 581010b8d2..b2639281d5 100644 --- a/Content.Client/Chat/SpeechBubble.cs +++ b/Content.Client/Chat/SpeechBubble.cs @@ -74,17 +74,13 @@ namespace Content.Client.Chat ForceRunStyleUpdate(); - ContentHeight = bubble.CombinedMinimumSize.Y; + bubble.Measure(Vector2.Infinity); + ContentHeight = bubble.DesiredSize.Y; _verticalOffsetAchieved = -ContentHeight; } protected abstract Control BuildBubble(string text); - protected override Vector2 CalculateMinimumSize() - { - return (base.CalculateMinimumSize().X, 0); - } - protected override void FrameUpdate(FrameEventArgs args) { base.FrameUpdate(args); @@ -122,7 +118,7 @@ namespace Content.Client.Chat LayoutContainer.SetPosition(this, screenPos); var height = MathHelper.Clamp(lowerCenter.Y - screenPos.Y, 0, ContentHeight); - LayoutContainer.SetSize(this, (Size.X, height)); + SetHeight = height; } private void Die() diff --git a/Content.Client/ClientNotifyManager.cs b/Content.Client/ClientNotifyManager.cs index 6a647a82f8..d9c32ab9fa 100644 --- a/Content.Client/ClientNotifyManager.cs +++ b/Content.Client/ClientNotifyManager.cs @@ -102,7 +102,8 @@ namespace Content.Client }; _userInterfaceManager.PopupRoot.AddChild(label); - var minimumSize = label.CombinedMinimumSize; + label.Measure(Vector2.Infinity); + var minimumSize = label.DesiredSize; label.InitialPos = (coordinates.Position / _userInterfaceManager.UIScale) - minimumSize / 2; LayoutContainer.SetPosition(label, label.InitialPos); @@ -149,7 +150,7 @@ namespace Content.Client var position = Entity == null ? InitialPos - : (_eyeManager.CoordinatesToScreen(Entity.Transform.Coordinates).Position / UIScale) - CombinedMinimumSize / 2; + : (_eyeManager.CoordinatesToScreen(Entity.Transform.Coordinates).Position / UIScale) - DesiredSize / 2; LayoutContainer.SetPosition(this, position - (0, 20 * (TimeLeft * TimeLeft + TimeLeft))); diff --git a/Content.Client/Command/CommunicationsConsoleMenu.cs b/Content.Client/Command/CommunicationsConsoleMenu.cs index 565f3ca670..8bfbea72a0 100644 --- a/Content.Client/Command/CommunicationsConsoleMenu.cs +++ b/Content.Client/Command/CommunicationsConsoleMenu.cs @@ -12,8 +12,6 @@ namespace Content.Client.Command { public class CommunicationsConsoleMenu : SS14Window { - protected override Vector2? CustomSize => new Vector2(600, 400); - private CommunicationsConsoleBoundUserInterface Owner { get; set; } private readonly CancellationTokenSource _timerCancelTokenSource = new(); public readonly Button EmergencyShuttleButton; @@ -21,25 +19,26 @@ namespace Content.Client.Command public CommunicationsConsoleMenu(CommunicationsConsoleBoundUserInterface owner) { + SetSize = MinSize = (600, 400); IoCManager.InjectDependencies(this); Title = Loc.GetString("Communications Console"); Owner = owner; - _countdownLabel = new RichTextLabel(){CustomMinimumSize = new Vector2(0, 200)}; + _countdownLabel = new RichTextLabel(){MinSize = new Vector2(0, 200)}; EmergencyShuttleButton = new Button(); EmergencyShuttleButton.OnPressed += (_) => Owner.EmergencyShuttleButtonPressed(); EmergencyShuttleButton.Disabled = !owner.CanCall; - var vbox = new VBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand}; + var vbox = new VBoxContainer() {HorizontalExpand = true, VerticalExpand = true}; vbox.AddChild(_countdownLabel); vbox.AddChild(EmergencyShuttleButton); - var hbox = new HBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand}; - hbox.AddChild(new Control(){CustomMinimumSize = new Vector2(100,0), SizeFlagsHorizontal = SizeFlags.FillExpand}); + var hbox = new HBoxContainer() {HorizontalExpand = true, VerticalExpand = true}; + hbox.AddChild(new Control(){MinSize = new Vector2(100,0), HorizontalExpand = true}); hbox.AddChild(vbox); - hbox.AddChild(new Control(){CustomMinimumSize = new Vector2(100,0), SizeFlagsHorizontal = SizeFlags.FillExpand}); + hbox.AddChild(new Control(){MinSize = new Vector2(100,0), HorizontalExpand = true}); Contents.AddChild(hbox); diff --git a/Content.Client/Construction/ConstructionMenu.xaml b/Content.Client/Construction/ConstructionMenu.xaml index 0794b6beb2..e4794cd1b3 100644 --- a/Content.Client/Construction/ConstructionMenu.xaml +++ b/Content.Client/Construction/ConstructionMenu.xaml @@ -1,27 +1,27 @@ - - - - - + + + + + - + - - - - - - - + + + + + + + - - -