From: eoineoineoin Date: Tue, 21 Oct 2025 22:23:52 +0000 (+0100) Subject: Add a sheetlet for ConfirmButton (#41011) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=914ae617ac01edbd6cf22f2453230bb1600a551b;p=space-station-14.git Add a sheetlet for ConfirmButton (#41011) * Add a sheetlet for ConfirmButton * Move sheetlet to central location; alphabetize using statements --- diff --git a/Content.Client/Stylesheets/Sheetlets/ConfirmButtonSheetlet.cs b/Content.Client/Stylesheets/Sheetlets/ConfirmButtonSheetlet.cs new file mode 100644 index 0000000000..45f85210bf --- /dev/null +++ b/Content.Client/Stylesheets/Sheetlets/ConfirmButtonSheetlet.cs @@ -0,0 +1,32 @@ +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.Controls; +using Content.Client.Stylesheets; +using Content.Client.Stylesheets.Stylesheets; +using static Content.Client.Stylesheets.StylesheetHelpers; + +namespace Content.Client.UserInterface.Controls; + +[CommonSheetlet] +public sealed class ConfirmButtonSheetlet : Sheetlet +{ + public override StyleRule[] GetRules(NanotrasenStylesheet sheet, object config) + { + return [ + E() + .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassNormal) + .Prop(Control.StylePropertyModulateSelf, sheet.NegativePalette.Element), + + E() + .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassHover) + .Prop(Control.StylePropertyModulateSelf, sheet.NegativePalette.HoveredElement), + + E() + .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassPressed) + .Prop(Control.StylePropertyModulateSelf, sheet.NegativePalette.PressedElement), + + E() + .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassDisabled) + .Prop(Control.StylePropertyModulateSelf, sheet.NegativePalette.DisabledElement), + ]; + } +} diff --git a/Content.Client/Stylesheets/StyleNano.cs b/Content.Client/Stylesheets/StyleNano.cs index 573b83cca4..b1c20d1814 100644 --- a/Content.Client/Stylesheets/StyleNano.cs +++ b/Content.Client/Stylesheets/StyleNano.cs @@ -740,23 +740,6 @@ namespace Content.Client.Stylesheets .Pseudo(ContainerButton.StylePseudoClassDisabled) .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDisabled), - // Colors for confirm buttons confirm states. - Element() - .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassNormal) - .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDefault), - - Element() - .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassHover) - .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionHovered), - - Element() - .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassPressed) - .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionPressed), - - Element() - .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassDisabled) - .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDisabled), - new StyleRule(new SelectorChild( new SelectorElement(typeof(Button), null, null, new[] {ContainerButton.StylePseudoClassDisabled}), new SelectorElement(typeof(Label), null, null, null)),