diff --git a/Content.Client/UserInterface/NanoStyle.cs b/Content.Client/UserInterface/NanoStyle.cs index 9ca13847cc..613e6b9e66 100644 --- a/Content.Client/UserInterface/NanoStyle.cs +++ b/Content.Client/UserInterface/NanoStyle.cs @@ -49,37 +49,32 @@ namespace Content.Client.UserInterface windowBackground.SetPatchMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2); windowBackground.SetExpandMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2); - var buttonNormalTex = resCache.GetTexture("/Nano/button_normal.png"); + // Button styles. + var buttonTex = resCache.GetTexture("/Nano/button.svg.96dpi.png"); var buttonNormal = new StyleBoxTexture { - Texture = buttonNormalTex, + Texture = buttonTex, + Modulate = Color.FromHex("#464966") }; - buttonNormal.SetPatchMargin(StyleBox.Margin.All, 2); - buttonNormal.SetContentMarginOverride(StyleBox.Margin.Horizontal, 8); + buttonNormal.SetPatchMargin(StyleBox.Margin.All, 8); + buttonNormal.SetPadding(StyleBox.Margin.All, 1); + buttonNormal.SetContentMarginOverride(StyleBox.Margin.Vertical, 2); + buttonNormal.SetContentMarginOverride(StyleBox.Margin.Horizontal, 6); - var buttonHoverTex = resCache.GetTexture("/Nano/button_hover.png"); - var buttonHover = new StyleBoxTexture + var buttonHover = new StyleBoxTexture(buttonNormal) { - Texture = buttonHoverTex, + Modulate = Color.FromHex("#575b7f") }; - buttonHover.SetPatchMargin(StyleBox.Margin.All, 2); - buttonHover.SetContentMarginOverride(StyleBox.Margin.Horizontal, 8); - var buttonPressedTex = resCache.GetTexture("/Nano/button_pressed.png"); - var buttonPressed = new StyleBoxTexture + var buttonPressed = new StyleBoxTexture(buttonNormal) { - Texture = buttonPressedTex, + Modulate = Color.FromHex("#3e6c45") }; - buttonPressed.SetPatchMargin(StyleBox.Margin.All, 2); - buttonPressed.SetContentMarginOverride(StyleBox.Margin.Horizontal, 8); - var buttonDisabledTex = resCache.GetTexture("/Nano/button_disabled.png"); - var buttonDisabled = new StyleBoxTexture + var buttonDisabled = new StyleBoxTexture(buttonNormal) { - Texture = buttonDisabledTex, + Modulate = Color.FromHex("#30313c") }; - buttonDisabled.SetPatchMargin(StyleBox.Margin.All, 2); - buttonDisabled.SetContentMarginOverride(StyleBox.Margin.Horizontal, 8); var lineEditTex = resCache.GetTexture("/Nano/lineedit.png"); var lineEdit = new StyleBoxTexture @@ -154,7 +149,7 @@ namespace Content.Client.UserInterface // Placeholder var placeholderTexture = resCache.GetTexture("/Nano/placeholder.png"); - var placeholder = new StyleBoxTexture { Texture = placeholderTexture }; + var placeholder = new StyleBoxTexture {Texture = placeholderTexture}; placeholder.SetPatchMargin(StyleBox.Margin.All, 24); placeholder.SetExpandMargin(StyleBox.Margin.All, -5); @@ -212,7 +207,7 @@ namespace Content.Client.UserInterface // Window close button hover. new StyleRule( new SelectorElement(typeof(TextureButton), new[] {SS14Window.StyleClassWindowCloseButton}, null, - new [] {TextureButton.StylePseudoClassHover}), + new[] {TextureButton.StylePseudoClassHover}), new[] { new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#7F3636")), @@ -220,7 +215,7 @@ namespace Content.Client.UserInterface // Window close button pressed. new StyleRule( new SelectorElement(typeof(TextureButton), new[] {SS14Window.StyleClassWindowCloseButton}, null, - new [] {TextureButton.StylePseudoClassPressed}), + new[] {TextureButton.StylePseudoClassPressed}), new[] { new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#753131")), @@ -228,25 +223,25 @@ namespace Content.Client.UserInterface // Regular buttons! new StyleRule( - new SelectorElement(typeof(Button), null, null, new [] {Button.StylePseudoClassNormal}), + new SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassNormal}), new[] { new StyleProperty(Button.StylePropertyStyleBox, buttonNormal), }), new StyleRule( - new SelectorElement(typeof(Button), null, null, new [] {Button.StylePseudoClassHover}), + 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 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 SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassDisabled}), new[] { new StyleProperty(Button.StylePropertyStyleBox, buttonDisabled), @@ -284,7 +279,8 @@ namespace Content.Client.UserInterface new StyleProperty("font-color", new Color(192, 192, 192)), }), - new StyleRule(new SelectorElement(typeof(LineEdit), null, null, new [] {LineEdit.StylePseudoClassPlaceholder}), + new StyleRule( + new SelectorElement(typeof(LineEdit), null, null, new[] {LineEdit.StylePseudoClassPlaceholder}), new[] { new StyleProperty("font-color", Color.Gray), @@ -307,14 +303,16 @@ namespace Content.Client.UserInterface vScrollBarGrabberNormal), }), - new StyleRule(new SelectorElement(typeof(VScrollBar), null, null, new [] {ScrollBar.StylePseudoClassHover}), + new StyleRule( + new SelectorElement(typeof(VScrollBar), null, null, new[] {ScrollBar.StylePseudoClassHover}), new[] { new StyleProperty(ScrollBar.StylePropertyGrabber, vScrollBarGrabberHover), }), - new StyleRule(new SelectorElement(typeof(VScrollBar), null, null, new [] {ScrollBar.StylePseudoClassGrabbed}), + new StyleRule( + new SelectorElement(typeof(VScrollBar), null, null, new[] {ScrollBar.StylePseudoClassGrabbed}), new[] { new StyleProperty(ScrollBar.StylePropertyGrabber, @@ -328,14 +326,16 @@ namespace Content.Client.UserInterface hScrollBarGrabberNormal), }), - new StyleRule(new SelectorElement(typeof(HScrollBar), null, null, new [] {ScrollBar.StylePseudoClassHover}), + new StyleRule( + new SelectorElement(typeof(HScrollBar), null, null, new[] {ScrollBar.StylePseudoClassHover}), new[] { new StyleProperty(ScrollBar.StylePropertyGrabber, hScrollBarGrabberHover), }), - new StyleRule(new SelectorElement(typeof(HScrollBar), null, null, new [] {ScrollBar.StylePseudoClassGrabbed}), + new StyleRule( + new SelectorElement(typeof(HScrollBar), null, null, new[] {ScrollBar.StylePseudoClassGrabbed}), new[] { new StyleProperty(ScrollBar.StylePropertyGrabber, @@ -356,10 +356,11 @@ namespace Content.Client.UserInterface new StyleProperty(CheckBox.StylePropertyIcon, checkBoxTextureUnchecked), }), - new StyleRule(new SelectorElement(typeof(CheckBox), null, null, new [] {Button.StylePseudoClassPressed}), new[] - { - new StyleProperty(CheckBox.StylePropertyIcon, checkBoxTextureChecked), - }), + new StyleRule(new SelectorElement(typeof(CheckBox), null, null, new[] {Button.StylePseudoClassPressed}), + new[] + { + new StyleProperty(CheckBox.StylePropertyIcon, checkBoxTextureChecked), + }), new StyleRule(new SelectorElement(typeof(CheckBox), null, null, null), new[] { @@ -372,7 +373,7 @@ namespace Content.Client.UserInterface new StyleProperty(PanelContainer.StylePropertyPanel, tooltipBox) }), - new StyleRule(new SelectorElement(typeof(PanelContainer), new []{"tooltipBox"}, null, null), new[] + new StyleRule(new SelectorElement(typeof(PanelContainer), new[] {"tooltipBox"}, null, null), new[] { new StyleProperty(PanelContainer.StylePropertyPanel, tooltipBox) }), @@ -411,100 +412,112 @@ namespace Content.Client.UserInterface }), // Placeholder - new StyleRule(new SelectorElement(typeof(Placeholder), null, null, null), new [] + new StyleRule(new SelectorElement(typeof(Placeholder), null, null, null), new[] { new StyleProperty(PanelContainer.StylePropertyPanel, placeholder), }), - new StyleRule(new SelectorElement(typeof(Label), new []{Placeholder.StyleClassPlaceholderText}, null, null), new [] - { - new StyleProperty(Label.StylePropertyFont, notoSans16), - new StyleProperty(Label.StylePropertyFontColor, new Color(103, 103, 103, 128)), - }), + new StyleRule( + new SelectorElement(typeof(Label), new[] {Placeholder.StyleClassPlaceholderText}, null, null), new[] + { + new StyleProperty(Label.StylePropertyFont, notoSans16), + new StyleProperty(Label.StylePropertyFontColor, new Color(103, 103, 103, 128)), + }), // Big Label - new StyleRule(new SelectorElement(typeof(Label), new []{StyleClassLabelHeading}, null, null), new [] + new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeading}, null, null), new[] { new StyleProperty(Label.StylePropertyFont, notoSansBold16), new StyleProperty(Label.StylePropertyFontColor, NanoGold), - } ), + }), // Small Label - new StyleRule(new SelectorElement(typeof(Label), new []{StyleClassLabelSubText}, null, null), new [] + new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSubText}, null, null), new[] { new StyleProperty(Label.StylePropertyFont, notoSans10), new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray), - } ), + }), - new StyleRule(new SelectorElement(typeof(Label), new []{StyleClassLabelSecondaryColor}, null, null), new [] - { - new StyleProperty(Label.StylePropertyFont, notoSans12), - new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray), - } ), + new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSecondaryColor}, null, null), + new[] + { + new StyleProperty(Label.StylePropertyFont, notoSans12), + new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray), + }), // Big Button - new StyleRule(new SelectorElement(typeof(Button), new []{StyleClassButtonBig}, null, null), new [] + new StyleRule(new SelectorElement(typeof(Button), new[] {StyleClassButtonBig}, null, null), new[] { new StyleProperty("font", notoSans16) }), //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[] { new StyleProperty(Label.StylePropertyFontColor, new Color(0.8f, 0.0f, 0.0f)) }), - new StyleRule(new SelectorElement(typeof(Label), new []{StyleClassPowerStateLow}, null, null), new [] + new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateLow}, null, null), new[] { new StyleProperty(Label.StylePropertyFontColor, new Color(0.9f, 0.36f, 0.0f)) }), - new StyleRule(new SelectorElement(typeof(Label), new []{StyleClassPowerStateGood}, null, null), new [] + new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateGood}, null, null), new[] { new StyleProperty(Label.StylePropertyFontColor, new Color(0.024f, 0.8f, 0.0f)) }), // Those top menu buttons. new StyleRule( - new SelectorElement(typeof(GameHud.TopButton), null, null, new [] {Button.StylePseudoClassNormal}), new [] - { - new StyleProperty(Button.StylePropertyStyleBox, buttonNormal), - }), + new SelectorElement(typeof(GameHud.TopButton), null, null, new[] {Button.StylePseudoClassNormal}), + new[] + { + new StyleProperty(Button.StylePropertyStyleBox, buttonNormal), + }), new StyleRule( - new SelectorElement(typeof(GameHud.TopButton), null, null, new [] {Button.StylePseudoClassPressed}), new [] - { - new StyleProperty(Button.StylePropertyStyleBox, buttonPressed), - }), + new SelectorElement(typeof(GameHud.TopButton), null, null, new[] {Button.StylePseudoClassPressed}), + new[] + { + new StyleProperty(Button.StylePropertyStyleBox, buttonPressed), + }), new StyleRule( - new SelectorElement(typeof(GameHud.TopButton), null, null, new [] {Button.StylePseudoClassHover}), new [] - { - new StyleProperty(Button.StylePropertyStyleBox, buttonHover), - }), + new SelectorElement(typeof(GameHud.TopButton), null, null, new[] {Button.StylePseudoClassHover}), + new[] + { + new StyleProperty(Button.StylePropertyStyleBox, buttonHover), + }), new StyleRule( - new SelectorElement(typeof(Label), new [] {GameHud.TopButton.StyleClassLabelTopButton}, null, null), new [] - { - new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14), - }), + new SelectorElement(typeof(Label), new[] {GameHud.TopButton.StyleClassLabelTopButton}, null, null), + new[] + { + new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14), + }), // Targeting doll - new StyleRule(new SelectorElement(typeof(TextureButton), new []{TargetingDoll.StyleClassTargetDollZone}, null, new [] {TextureButton.StylePseudoClassNormal}), new [] - { - new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#F00")), - }), + new StyleRule( + new SelectorElement(typeof(TextureButton), new[] {TargetingDoll.StyleClassTargetDollZone}, null, + new[] {TextureButton.StylePseudoClassNormal}), new[] + { + new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#F00")), + }), - new StyleRule(new SelectorElement(typeof(TextureButton), new []{TargetingDoll.StyleClassTargetDollZone}, null, new [] {TextureButton.StylePseudoClassHover}), new [] - { - new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#0F0")), - }), + new StyleRule( + new SelectorElement(typeof(TextureButton), new[] {TargetingDoll.StyleClassTargetDollZone}, null, + new[] {TextureButton.StylePseudoClassHover}), new[] + { + new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#0F0")), + }), - new StyleRule(new SelectorElement(typeof(TextureButton), new []{TargetingDoll.StyleClassTargetDollZone}, null, new [] {TextureButton.StylePseudoClassPressed}), new [] - { - new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#00F")), - }), + new StyleRule( + new SelectorElement(typeof(TextureButton), new[] {TargetingDoll.StyleClassTargetDollZone}, null, + new[] {TextureButton.StylePseudoClassPressed}), new[] + { + new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#00F")), + }), }); } } diff --git a/Resources/Nano/button.svg b/Resources/Nano/button.svg new file mode 100644 index 0000000000..c960a55bf7 --- /dev/null +++ b/Resources/Nano/button.svg @@ -0,0 +1,69 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/Resources/Nano/button.svg.96dpi.png b/Resources/Nano/button.svg.96dpi.png new file mode 100644 index 0000000000..99f3291167 Binary files /dev/null and b/Resources/Nano/button.svg.96dpi.png differ diff --git a/Resources/Nano/button_disabled.png b/Resources/Nano/button_disabled.png deleted file mode 100644 index 857acde84a..0000000000 Binary files a/Resources/Nano/button_disabled.png and /dev/null differ diff --git a/Resources/Nano/button_hover.png b/Resources/Nano/button_hover.png deleted file mode 100644 index 54d425803e..0000000000 Binary files a/Resources/Nano/button_hover.png and /dev/null differ diff --git a/Resources/Nano/button_normal.png b/Resources/Nano/button_normal.png deleted file mode 100644 index 08e3ba30f4..0000000000 Binary files a/Resources/Nano/button_normal.png and /dev/null differ diff --git a/Resources/Nano/button_pressed.png b/Resources/Nano/button_pressed.png deleted file mode 100644 index 3edbe1f649..0000000000 Binary files a/Resources/Nano/button_pressed.png and /dev/null differ diff --git a/RobustToolbox b/RobustToolbox index 44ada991f2..cd7a4f0b15 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 44ada991f2221930a6cec3c7a492f9ae4673c006 +Subproject commit cd7a4f0b156a59510c85148f8cc28aa9b02154c8