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

@@ -5,6 +5,7 @@ using Robust.Client.UserInterface.Controls;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
namespace Content.Client.UserInterface
{
@@ -27,20 +28,24 @@ namespace Content.Client.UserInterface
var vBox = new VBoxContainer();
var contents = new VBoxContainer();
var contents = new VBoxContainer
{
Margin = new Thickness(2, 2, 2, 0),
VerticalExpand = true,
};
MasterVolumeSlider = new Slider
{
MinValue = 0.0f,
MaxValue = 100.0f,
SizeFlagsHorizontal = SizeFlags.FillExpand,
CustomMinimumSize = (80, 8),
HorizontalExpand = true,
MinSize = (80, 8),
Rounded = true
};
MasterVolumeLabel = new Label
{
CustomMinimumSize = (48, 0),
MinSize = (48, 0),
Align = Label.AlignMode.Right
};
@@ -48,20 +53,20 @@ namespace Content.Client.UserInterface
{
Children =
{
new Control {CustomMinimumSize = (4, 0)},
new Control {MinSize = (4, 0)},
new Label {Text = Loc.GetString("Master Volume:")},
new Control {CustomMinimumSize = (8, 0)},
new Control {MinSize = (8, 0)},
MasterVolumeSlider,
new Control {CustomMinimumSize = (8, 0)},
new Control {MinSize = (8, 0)},
MasterVolumeLabel,
new Control { CustomMinimumSize = (4, 0) },
new Control { MinSize = (4, 0) },
}
});
ApplyButton = new Button
{
Text = Loc.GetString("Apply"), TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkEnd
HorizontalAlignment = HAlignment.Right
};
vBox.AddChild(new Label
@@ -71,23 +76,13 @@ namespace Content.Client.UserInterface
StyleClasses = { StyleNano.StyleClassLabelKeyText }
});
vBox.AddChild(new MarginContainer
{
MarginLeftOverride = 2,
MarginTopOverride = 2,
MarginRightOverride = 2,
SizeFlagsVertical = SizeFlags.FillExpand,
Children =
{
contents
}
});
vBox.AddChild(contents);
ResetButton = new Button
{
Text = Loc.GetString("Reset all"),
StyleClasses = { StyleBase.ButtonCaution },
SizeFlagsHorizontal = SizeFlags.ShrinkEnd
HorizontalAlignment = HAlignment.Right
};
vBox.AddChild(new StripeBack
@@ -99,12 +94,12 @@ namespace Content.Client.UserInterface
new HBoxContainer
{
Align = BoxContainer.AlignMode.End,
SizeFlagsHorizontal = SizeFlags.FillExpand,
SizeFlagsVertical = SizeFlags.FillExpand,
HorizontalExpand = true,
VerticalExpand = true,
Children =
{
ResetButton,
new Control { CustomMinimumSize = (2, 0) },
new Control { MinSize = (2, 0) },
ApplyButton
}
}