WPF layout (#3346)

This commit is contained in:
Pieter-Jan Briers
2021-02-21 12:38:56 +01:00
committed by GitHub
parent 33d6975c25
commit b898443f28
121 changed files with 1420 additions and 2069 deletions

View File

@@ -164,7 +164,7 @@ namespace Content.Client.GameObjects.EntitySystems
{
_currentEntityList.List.AddChild(new PanelContainer
{
CustomMinimumSize = (0, 2),
MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")}
});
}
@@ -176,7 +176,8 @@ namespace Content.Client.GameObjects.EntitySystems
_userInterfaceManager.ModalRoot.AddChild(_currentEntityList);
var size = _currentEntityList.List.CombinedMinimumSize;
_currentEntityList.List.Measure(Vector2.Infinity);
var size = _currentEntityList.List.DesiredSize;
var box = UIBox2.FromDimensions(_userInterfaceManager.MousePositionScaled, size);
_currentEntityList.Open(box);
@@ -284,7 +285,7 @@ namespace Content.Client.GameObjects.EntitySystems
{
vBox.AddChild(new PanelContainer
{
CustomMinimumSize = (0, 2),
MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")}
});
}
@@ -306,7 +307,7 @@ namespace Content.Client.GameObjects.EntitySystems
{
vBox.AddChild(new PanelContainer
{
CustomMinimumSize = (0, 2),
MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")}
});
}
@@ -449,11 +450,11 @@ namespace Content.Client.GameObjects.EntitySystems
{
text = $"{text} ({entity.Uid})";
}
control.AddChild(new MarginContainer
control.AddChild(new Label
{
MarginLeftOverride = 4,
MarginRightOverride = 4,
Children = {new Label {Text = text}}
Margin = new Thickness(4, 0),
Text = text
});
AddChild(control);
@@ -486,7 +487,8 @@ namespace Content.Client.GameObjects.EntitySystems
var func = args.Function;
var funcId = _master._inputManager.NetworkBindMap.KeyFunctionID(args.Function);
var message = new FullInputCmdMessage(_master._gameTiming.CurTick, _master._gameTiming.TickFraction, funcId, BoundKeyState.Down,
var message = new FullInputCmdMessage(_master._gameTiming.CurTick, _master._gameTiming.TickFraction,
funcId, BoundKeyState.Down,
_entity.Transform.Coordinates,
args.PointerLocation, _entity.Uid);
@@ -546,12 +548,12 @@ namespace Content.Client.GameObjects.EntitySystems
{
(_icon = new TextureRect
{
CustomMinimumSize = (32, 32),
MinSize = (32, 32),
Stretch = TextureRect.StretchMode.KeepCentered
}),
(_label = new Label()),
// Padding
new Control {CustomMinimumSize = (8, 0)}
new Control {MinSize = (8, 0)}
}
});
}
@@ -603,17 +605,17 @@ namespace Content.Client.GameObjects.EntitySystems
{
(_icon = new TextureRect
{
CustomMinimumSize = (32, 32),
MinSize = (32, 32),
Stretch = TextureRect.StretchMode.KeepCentered
}),
(_label = new Label
{
SizeFlagsHorizontal = SizeFlags.FillExpand
HorizontalExpand = true
}),
// Padding
new Control {CustomMinimumSize = (8, 0)},
new Control {MinSize = (8, 0)},
new TextureRect
{
@@ -662,7 +664,7 @@ namespace Content.Client.GameObjects.EntitySystems
{
popup.List.AddChild(new PanelContainer
{
CustomMinimumSize = (0, 2),
MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")}
});
}