Files
space-station-14/Content.Client/Stylesheets/CommonStylesheet.cs
Absotively 6ee812cfe5 SwitchButton (#39161)
* Initial toggle switch styling

* tweak toggle switch textures

* Simplify toggle SVG images a bit

* Better name for switch button

* Update CheckButtons that were already just regular buttons

* Match checkbox/text field outline colour instead of slider outline colour

* Use switch button for APC power

* Update switch button styling; add separate style for power buttons

* Use new switch button in midi channels menu

* Add spacer

* adjust switch button icon proportions, position

* Add disabled toggle switch styles, use improved pressed style setup, make APC breaker state visible to all

* Use Janet Blackquill's icon design; remove StyleClassPowerSwitchButton. Co-authored-by: Janet Blackquill <uhhadd@gmail.com>

* Style switch children directly instead of with propagated styles

* Add attributions file

* Turns out source is a required field

* Move SwitchButton out of engine

* Move styles to sheetlet

* Make workaround for child controls not updating work in content

* Icon layers

* Set up ISwitchButtonConfig

* Fix disabled switch label font color

* Don't redefine base pseudostyles

* Use pseudoclass helpers for better readability

* Use margin instead of padding element

* Remove unused using statements

* Remove extra image file

* Update attributions for changed files
2026-01-22 17:31:56 +00:00

84 lines
4.9 KiB
C#

using Content.Client.Stylesheets.Palette;
using Content.Client.Stylesheets.SheetletConfigs;
using Robust.Shared.Utility;
namespace Content.Client.Stylesheets;
public abstract class CommonStylesheet : PalettedStylesheet, IButtonConfig, IWindowConfig, IIconConfig, ITabContainerConfig,
ISliderConfig, IRadialMenuConfig, IPlaceholderConfig, ITooltipConfig, IPanelConfig, INanoHeadingConfig,
ILineEditConfig, IStripebackConfig, ICheckboxConfig, ISwitchButtonConfig
{
/// <remarks>
/// This constructor will not access any virtual or abstract properties, so you can set them from your config.
/// </remarks>
protected CommonStylesheet(object config) : base(config) { }
ResPath ICheckboxConfig.CheckboxUncheckedPath => new("checkbox_unchecked.svg.96dpi.png");
ResPath ICheckboxConfig.CheckboxCheckedPath => new("checkbox_checked.svg.96dpi.png");
ResPath IStripebackConfig.StripebackPath => new("stripeback.svg.96dpi.png");
ResPath INanoHeadingConfig.NanoHeadingPath => new("nanoheading.svg.96dpi.png");
ResPath ILineEditConfig.LineEditPath => new("lineedit.png");
ResPath IPanelConfig.GeometricPanelBorderPath => new("geometric_panel_border.svg.96dpi.png");
ResPath IPanelConfig.BlackPanelDarkThinBorderPath => new("black_panel_dark_thin_border.png");
ResPath ITooltipConfig.TooltipBoxPath => new("tooltip.png");
ResPath ITooltipConfig.WhisperBoxPath => new("whisper.png");
ResPath IPlaceholderConfig.PlaceholderPath => new("placeholder.png");
ResPath IRadialMenuConfig.ButtonNormalPath => new("Radial/button_normal.png");
ResPath IRadialMenuConfig.ButtonHoverPath => new("Radial/button_hover.png");
ResPath IRadialMenuConfig.CloseNormalPath => new("Radial/close_normal.png");
ResPath IRadialMenuConfig.CloseHoverPath => new("Radial/close_hover.png");
ResPath IRadialMenuConfig.BackNormalPath => new("Radial/back_normal.png");
ResPath IRadialMenuConfig.BackHoverPath => new("Radial/back_hover.png");
ResPath ISliderConfig.SliderFillPath => new("slider_fill.svg.96dpi.png");
ResPath ISliderConfig.SliderOutlinePath => new("slider_outline.svg.96dpi.png");
ResPath ISliderConfig.SliderGrabber => new("slider_grabber.svg.96dpi.png");
ResPath ITabContainerConfig.TabContainerPanelPath => new("tabcontainer_panel.png");
ResPath IIconConfig.HelpIconPath => new("help.png");
ResPath IIconConfig.CrossIconPath => new("cross.svg.png");
ResPath IIconConfig.RefreshIconPath => new("circular_arrow.svg.96dpi.png");
ResPath IIconConfig.InvertedTriangleIconPath => new("inverted_triangle.svg.png");
ResPath IWindowConfig.WindowHeaderTexturePath => new("window_header.png");
ResPath IWindowConfig.WindowHeaderAlertTexturePath => new("window_header_alert.png");
ResPath IWindowConfig.WindowBackgroundPath => new("window_background.png");
ResPath IWindowConfig.WindowBackgroundBorderedPath => new("window_background_bordered.png");
ResPath IWindowConfig.TransparentWindowBackgroundBorderedPath => new("transparent_window_background_bordered.png");
ResPath IButtonConfig.BaseButtonPath => new("button.svg.96dpi.png");
ResPath IButtonConfig.OpenLeftButtonPath => new("button.svg.96dpi.png");
ResPath IButtonConfig.OpenRightButtonPath => new("button.svg.96dpi.png");
ResPath IButtonConfig.OpenBothButtonPath => new("button.svg.96dpi.png");
ResPath IButtonConfig.SmallButtonPath => new("button_small.svg.96dpi.png");
ResPath IButtonConfig.RoundedButtonPath => new("rounded_button.svg.96dpi.png");
ResPath IButtonConfig.RoundedButtonBorderedPath => new("rounded_button_bordered.svg.96dpi.png");
ResPath IButtonConfig.MonotoneBaseButtonPath => new("Monotone/monotone_button.svg.96dpi.png");
ResPath IButtonConfig.MonotoneOpenLeftButtonPath => new("Monotone/monotone_button_open_left.svg.96dpi.png");
ResPath IButtonConfig.MonotoneOpenRightButtonPath => new("Monotone/monotone_button_open_right.svg.96dpi.png");
ResPath IButtonConfig.MonotoneOpenBothButtonPath => new("Monotone/monotone_button_open_both.svg.96dpi.png");
ColorPalette IButtonConfig.ButtonPalette => PrimaryPalette with { PressedElement = PositivePalette.PressedElement };
ColorPalette IButtonConfig.PositiveButtonPalette => PositivePalette;
ColorPalette IButtonConfig.NegativeButtonPalette => NegativePalette;
ResPath ISwitchButtonConfig.SwitchButtonTrackFillPath => new("switchbutton_track_fill.svg.96dpi.png");
ResPath ISwitchButtonConfig.SwitchButtonTrackOutlinePath => new("switchbutton_track_outline.svg.96dpi.png");
ResPath ISwitchButtonConfig.SwitchButtonThumbFillPath => new("switchbutton_thumb_fill.svg.96dpi.png");
ResPath ISwitchButtonConfig.SwitchButtonThumbOutlinePath => new("switchbutton_thumb_outline.svg.96dpi.png");
ResPath ISwitchButtonConfig.SwitchButtonSymbolOffPath => new("switchbutton_symbol_off.svg.96dpi.png");
ResPath ISwitchButtonConfig.SwitchButtonSymbolOnPath => new("switchbutton_symbol_on.svg.96dpi.png");
}