Merge branches '20-02-17-upd' and 'triangle'

This commit is contained in:
Pieter-Jan Briers
2020-02-17 11:19:15 +01:00
9 changed files with 175 additions and 54 deletions

View File

@@ -91,14 +91,14 @@ namespace Content.Client.Construction
BuildButton = new Button BuildButton = new Button
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsHorizontal = SizeFlags.FillExpand,
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
Text = "Build!", Text = "Build!",
Disabled = true, Disabled = true,
ToggleMode = false ToggleMode = false
}; };
EraseButton = new Button EraseButton = new Button
{ {
TextAlign = Button.AlignMode.Center, Text = "Clear Ghosts", ToggleMode = true TextAlign = Label.AlignMode.Center, Text = "Clear Ghosts", ToggleMode = true
}; };
buttonsContainer.AddChild(BuildButton); buttonsContainer.AddChild(BuildButton);
buttonsContainer.AddChild(EraseButton); buttonsContainer.AddChild(EraseButton);

View File

@@ -56,7 +56,7 @@ namespace Content.Client.Instruments
midiInputButton = new Button() midiInputButton = new Button()
{ {
Text = "MIDI Input", Text = "MIDI Input",
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsHorizontal = SizeFlags.FillExpand,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
ToggleMode = true, ToggleMode = true,
@@ -74,7 +74,7 @@ namespace Content.Client.Instruments
var midiFileButton = new Button() var midiFileButton = new Button()
{ {
Text = "Open File", Text = "Open File",
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsHorizontal = SizeFlags.FillExpand,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
@@ -92,7 +92,7 @@ namespace Content.Client.Instruments
midiLoopButton = new Button() midiLoopButton = new Button()
{ {
Text = "Loop", Text = "Loop",
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsHorizontal = SizeFlags.FillExpand,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
ToggleMode = true, ToggleMode = true,
@@ -111,7 +111,7 @@ namespace Content.Client.Instruments
midiStopButton = new Button() midiStopButton = new Button()
{ {
Text = "Stop", Text = "Stop",
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsHorizontal = SizeFlags.FillExpand,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
Disabled = !_owner.Instrument.IsMidiOpen, Disabled = !_owner.Instrument.IsMidiOpen,

View File

@@ -65,7 +65,7 @@ namespace Content.Client.Research
QueueButton = new Button() QueueButton = new Button()
{ {
Text = "Queue", Text = "Queue",
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Fill, SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
@@ -73,7 +73,7 @@ namespace Content.Client.Research
ServerConnectButton = new Button() ServerConnectButton = new Button()
{ {
Text = "Server list", Text = "Server list",
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Fill, SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
@@ -81,7 +81,7 @@ namespace Content.Client.Research
ServerSyncButton = new Button() ServerSyncButton = new Button()
{ {
Text = "Sync", Text = "Sync",
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Fill, SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
@@ -111,7 +111,7 @@ namespace Content.Client.Research
var filterButton = new Button() var filterButton = new Button()
{ {
Text = "Filter", Text = "Filter",
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Fill, SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
Disabled = true, Disabled = true,

View File

@@ -98,13 +98,13 @@ namespace Content.Client.UserInterface.Cargo
CallShuttleButton = new Button() CallShuttleButton = new Button()
{ {
Text = _loc.GetString("Call Shuttle"), Text = _loc.GetString("Call Shuttle"),
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand SizeFlagsHorizontal = SizeFlags.FillExpand
}; };
PermissionsButton = new Button() PermissionsButton = new Button()
{ {
Text = _loc.GetString("Permissions"), Text = _loc.GetString("Permissions"),
TextAlign = Button.AlignMode.Center TextAlign = Label.AlignMode.Center
}; };
buttons.AddChild(CallShuttleButton); buttons.AddChild(CallShuttleButton);
buttons.AddChild(PermissionsButton); buttons.AddChild(PermissionsButton);

View File

@@ -56,7 +56,7 @@ namespace Content.Client.UserInterface.Cargo
SubmitButton = new Button() SubmitButton = new Button()
{ {
Text = _loc.GetString("OK"), Text = _loc.GetString("OK"),
TextAlign = Button.AlignMode.Center, TextAlign = Label.AlignMode.Center,
}; };
vBox.AddChild(SubmitButton); vBox.AddChild(SubmitButton);

View File

@@ -66,6 +66,8 @@ namespace Content.Client.UserInterface
windowBackground.SetPatchMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2); windowBackground.SetPatchMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2);
windowBackground.SetExpandMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2); windowBackground.SetExpandMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2);
var textureInvertedTriangle = resCache.GetTexture("/nano/inverted_triangle.svg.png");
// Button styles. // Button styles.
var buttonTex = resCache.GetTexture("/Nano/button.svg.96dpi.png"); var buttonTex = resCache.GetTexture("/Nano/button.svg.96dpi.png");
var buttonNormal = new StyleBoxTexture var buttonNormal = new StyleBoxTexture
@@ -305,37 +307,40 @@ namespace Content.Client.UserInterface
}), }),
// Regular buttons! // Regular buttons!
new StyleRule( new StyleRule(new SelectorElement(typeof(Button), null, null, new[] {ContainerButton.StylePseudoClassNormal}), new[]
new SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassNormal}), {
new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonNormal),
}),
new StyleRule(new SelectorElement(typeof(Button), null, null, new[] {ContainerButton.StylePseudoClassHover}), new[]
{
new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonHover),
}),
new StyleRule(new SelectorElement(typeof(Button), null, null, new[] {ContainerButton.StylePseudoClassPressed}), new[]
{
new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonPressed),
}),
new StyleRule(new SelectorElement(typeof(Button), null, null, new[] {ContainerButton.StylePseudoClassDisabled}), new[]
{
new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonDisabled),
}),
new StyleRule(new SelectorElement(typeof(Label), new[] { Button.StyleClassButton }, null, null), new[]
{
new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Center),
}),
new StyleRule(new SelectorChild(
new SelectorElement(typeof(Button), null, null, new[] {ContainerButton.StylePseudoClassDisabled}),
new SelectorElement(typeof(Label), null, null, null)),
new[] new[]
{ {
new StyleProperty(Button.StylePropertyStyleBox, buttonNormal),
}),
new StyleRule(
new SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassHover}),
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonHover),
}),
new StyleRule(
new SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassPressed}),
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonPressed),
}),
new StyleRule(
new SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassDisabled}),
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonDisabled),
new StyleProperty("font-color", Color.FromHex("#E5E5E581")), new StyleProperty("font-color", Color.FromHex("#E5E5E581")),
}), }),
// Main menu: Make those buttons bigger. // Main menu: Make those buttons bigger.
new StyleRule( new StyleRule(new SelectorChild(
new SelectorChild( new SelectorElement(typeof(Button), null, "mainMenu", null),
new SelectorElement(null, null, "mainMenuVBox", null), new SelectorElement(typeof(Label), null, null, null)),
new SelectorElement(typeof(Button), null, null, null)),
new[] new[]
{ {
new StyleProperty("font", notoSansBold16), new StyleProperty("font", notoSansBold16),
@@ -434,20 +439,19 @@ namespace Content.Client.UserInterface
}), }),
// CheckBox // CheckBox
new StyleRule(new SelectorElement(typeof(CheckBox), null, null, null), new[] new StyleRule(new SelectorElement(typeof(TextureRect), new [] { CheckBox.StyleClassCheckBox }, null, null), new[]
{ {
new StyleProperty(CheckBox.StylePropertyIcon, checkBoxTextureUnchecked), new StyleProperty(TextureRect.StylePropertyTexture, checkBoxTextureUnchecked),
}), }),
new StyleRule(new SelectorElement(typeof(CheckBox), null, null, new[] {Button.StylePseudoClassPressed}), new StyleRule(new SelectorElement(typeof(TextureRect), new [] { CheckBox.StyleClassCheckBox, CheckBox.StyleClassCheckBoxChecked }, null, null), new[]
new[]
{
new StyleProperty(CheckBox.StylePropertyIcon, checkBoxTextureChecked),
}),
new StyleRule(new SelectorElement(typeof(CheckBox), null, null, null), new[]
{ {
new StyleProperty(CheckBox.StylePropertyHSeparation, 3), new StyleProperty(TextureRect.StylePropertyTexture, checkBoxTextureChecked),
}),
new StyleRule(new SelectorElement(typeof(HBoxContainer), new [] { CheckBox.StyleClassCheckBox }, null, null), new[]
{
new StyleProperty(BoxContainer.StylePropertySeparation, 10),
}), }),
// Tooltip // Tooltip
@@ -556,10 +560,13 @@ namespace Content.Client.UserInterface
}), }),
// Big Button // Big Button
new StyleRule(new SelectorElement(typeof(Button), new[] {StyleClassButtonBig}, null, null), new[] new StyleRule(new SelectorChild(
{ new SelectorElement(typeof(Button), new[] {StyleClassButtonBig}, null, null),
new StyleProperty("font", notoSans16) new SelectorElement(typeof(Label), null, null, null)),
}), new[]
{
new StyleProperty("font", notoSans16)
}),
//APC and SMES power state label colors //APC and SMES power state label colors
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateNone}, null, null), new[] new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateNone}, null, null), new[]
@@ -684,7 +691,36 @@ namespace Content.Client.UserInterface
new StyleRule(new SelectorElement(typeof(Slider), new []{StyleClassSliderBlue}, null, null), new [] new StyleRule(new SelectorElement(typeof(Slider), new []{StyleClassSliderBlue}, null, null), new []
{ {
new StyleProperty(Slider.StylePropertyFill, sliderFillBlue), new StyleProperty(Slider.StylePropertyFill, sliderFillBlue),
}) }),
// OptionButton
new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassNormal}), new[]
{
new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonNormal),
}),
new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassHover}), new[]
{
new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonHover),
}),
new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassPressed}), new[]
{
new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonPressed),
}),
new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassDisabled}), new[]
{
new StyleProperty(ContainerButton.StylePropertyStyleBox, buttonDisabled),
}),
new StyleRule(new SelectorElement(typeof(TextureRect), new[] {OptionButton.StyleClassOptionTriangle}, null, null), new[]
{
new StyleProperty(TextureRect.StylePropertyTexture, textureInvertedTriangle),
//new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#FFFFFF")),
}),
new StyleRule(new SelectorElement(typeof(Label), new[] { OptionButton.StyleClassOptionButton }, null, null), new[]
{
new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Center),
}),
}); });
} }
} }

View File

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="12"
height="8"
viewBox="0 0 12 8"
version="1.1"
id="svg5650"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="inverted_triangle.svg"
inkscape:export-filename="H:\Code\GitHub\space-station-14\Resources\Nano\inverted_triangle.svg.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs5644" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="31.678384"
inkscape:cx="8.8993386"
inkscape:cy="4.276435"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:snap-global="false"
inkscape:snap-bbox="true"
inkscape:snap-page="true"
inkscape:pagecheckerboard="true"
inkscape:window-width="1280"
inkscape:window-height="961"
inkscape:window-x="1432"
inkscape:window-y="-2"
inkscape:window-maximized="1"
units="px" />
<metadata
id="metadata5647">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
style="display:inline;opacity:1"
transform="translate(-1.0101525,-296.07106)">
<path
sodipodi:type="star"
style="fill:#fffcff;fill-opacity:1;stroke:none;stroke-width:3.62899995;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path6203"
sodipodi:sides="3"
sodipodi:cx="10.316734"
sodipodi:cy="291.04364"
sodipodi:r1="8.2837381"
sodipodi:r2="4.1418691"
sodipodi:arg1="0.52359878"
sodipodi:arg2="1.5707963"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 17.490662,295.18551 -14.3478554,0 7.1739274,-12.42561 z"
inkscape:transform-center-y="1.3333296"
transform="matrix(0.83636193,0,0,-0.64383171,-1.6183713,486.12085)"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B