Skip to content

Commit 5cbb3f1

Browse files
committed
Fix UI layout bugs with the PA.
1 parent 4272716 commit 5cbb3f1

File tree

1 file changed

+45
-39
lines changed

1 file changed

+45
-39
lines changed

Content.Client/UserInterface/ParticleAccelerator/ParticleAcceleratorControlMenu.cs

+45-39
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ public ParticleAcceleratorControlMenu(ParticleAcceleratorBoundUserInterface owne
188188
new MarginContainer
189189
{
190190
MarginLeftOverride = 4,
191+
SizeFlagsHorizontal = SizeFlags.FillExpand,
191192
Children =
192193
{
193194
new VBoxContainer
194195
{
195-
SizeFlagsHorizontal = SizeFlags.FillExpand,
196196
Children =
197197
{
198198
new HBoxContainer
@@ -246,55 +246,61 @@ public ParticleAcceleratorControlMenu(ParticleAcceleratorBoundUserInterface owne
246246
}
247247
}
248248
},
249-
new VBoxContainer
249+
new MarginContainer
250250
{
251-
SizeFlagsHorizontal = SizeFlags.FillExpand,
251+
CustomMinimumSize = (186, 0),
252252
Children =
253253
{
254-
(_statusLabel = new Label
255-
{
256-
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
257-
}),
258-
new Control
259-
{
260-
CustomMinimumSize = (0, 20)
261-
},
262-
new PanelContainer
254+
new VBoxContainer
263255
{
264-
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
265-
PanelOverride = back2,
266256
Children =
267257
{
268-
new GridContainer
258+
(_statusLabel = new Label
259+
{
260+
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
261+
}),
262+
new Control
269263
{
270-
Columns = 3,
271-
VSeparationOverride = 0,
272-
HSeparationOverride = 0,
264+
CustomMinimumSize = (0, 20)
265+
},
266+
new PanelContainer
267+
{
268+
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
269+
PanelOverride = back2,
273270
Children =
274271
{
275-
new Control {CustomMinimumSize = imgSize},
276-
(_endCapTexture = Segment("end_cap")),
277-
new Control {CustomMinimumSize = imgSize},
278-
(_controlBoxTexture = Segment("control_box")),
279-
(_fuelChamberTexture = Segment("fuel_chamber")),
280-
new Control {CustomMinimumSize = imgSize},
281-
new Control {CustomMinimumSize = imgSize},
282-
(_powerBoxTexture = Segment("power_box")),
283-
new Control {CustomMinimumSize = imgSize},
284-
(_emitterLeftTexture = Segment("emitter_left")),
285-
(_emitterCenterTexture = Segment("emitter_center")),
286-
(_emitterRightTexture = Segment("emitter_right")),
272+
new GridContainer
273+
{
274+
Columns = 3,
275+
VSeparationOverride = 0,
276+
HSeparationOverride = 0,
277+
Children =
278+
{
279+
new Control {CustomMinimumSize = imgSize},
280+
(_endCapTexture = Segment("end_cap")),
281+
new Control {CustomMinimumSize = imgSize},
282+
(_controlBoxTexture = Segment("control_box")),
283+
(_fuelChamberTexture = Segment("fuel_chamber")),
284+
new Control {CustomMinimumSize = imgSize},
285+
new Control {CustomMinimumSize = imgSize},
286+
(_powerBoxTexture = Segment("power_box")),
287+
new Control {CustomMinimumSize = imgSize},
288+
(_emitterLeftTexture = Segment("emitter_left")),
289+
(_emitterCenterTexture = Segment("emitter_center")),
290+
(_emitterRightTexture = Segment("emitter_right")),
291+
}
292+
}
287293
}
288-
}
294+
},
295+
(_scanButton = new Button
296+
{
297+
Text = Loc.GetString("Scan Parts"),
298+
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
299+
})
289300
}
290-
},
291-
(_scanButton = new Button
292-
{
293-
Text = Loc.GetString("Scan Parts"),
294-
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
295-
})
301+
}
296302
}
297-
}
303+
},
298304
}
299305
},
300306
new StripeBack
@@ -507,7 +513,7 @@ public PASegmentControl(ParticleAcceleratorControlMenu menu, IResourceCache cach
507513
public void SetPowerState(ParticleAcceleratorUIState state, bool exists)
508514
{
509515
_base.ShaderOverride = exists ? null : _menu._greyScaleShader;
510-
_base.ModulateSelfOverride = exists ? (Color?)null : new Color(127, 127, 127);
516+
_base.ModulateSelfOverride = exists ? (Color?) null : new Color(127, 127, 127);
511517

512518
if (!state.Enabled || !exists)
513519
{

0 commit comments

Comments
 (0)