diff --git a/Content.Client/Instruments/UI/ChannelsMenu.xaml b/Content.Client/Instruments/UI/ChannelsMenu.xaml
index e98b03e6b32..f902cad4d0f 100644
--- a/Content.Client/Instruments/UI/ChannelsMenu.xaml
+++ b/Content.Client/Instruments/UI/ChannelsMenu.xaml
@@ -1,5 +1,5 @@
+ xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls">
-
+
diff --git a/Content.Client/Instruments/UI/ChannelsMenu.xaml.cs b/Content.Client/Instruments/UI/ChannelsMenu.xaml.cs
index da164a633cd..0f51c76f8fc 100644
--- a/Content.Client/Instruments/UI/ChannelsMenu.xaml.cs
+++ b/Content.Client/Instruments/UI/ChannelsMenu.xaml.cs
@@ -37,7 +37,6 @@ public sealed partial class ChannelsMenu : DefaultWindow
private void OnDisplayTrackNamesPressed(BaseButton.ButtonEventArgs obj)
{
- DisplayTrackNames.SetClickPressed(!DisplayTrackNames.Pressed);
Populate();
}
diff --git a/Content.Client/Power/APC/UI/ApcMenu.xaml b/Content.Client/Power/APC/UI/ApcMenu.xaml
index 7dd38c76fcb..24b1371f361 100644
--- a/Content.Client/Power/APC/UI/ApcMenu.xaml
+++ b/Content.Client/Power/APC/UI/ApcMenu.xaml
@@ -1,7 +1,6 @@
@@ -19,9 +18,7 @@
-
-
-
+
diff --git a/Content.Client/Power/APC/UI/ApcMenu.xaml.cs b/Content.Client/Power/APC/UI/ApcMenu.xaml.cs
index 097ee715819..df45853bfb8 100644
--- a/Content.Client/Power/APC/UI/ApcMenu.xaml.cs
+++ b/Content.Client/Power/APC/UI/ApcMenu.xaml.cs
@@ -33,10 +33,7 @@ namespace Content.Client.Power.APC.UI
{
var castState = (ApcBoundInterfaceState) state;
- if (!BreakerButton.Disabled)
- {
- BreakerButton.Pressed = castState.MainBreaker;
- }
+ BreakerButton.Pressed = castState.MainBreaker;
if (PowerLabel != null)
{
diff --git a/Content.Client/Stylesheets/CommonStylesheet.cs b/Content.Client/Stylesheets/CommonStylesheet.cs
index f8eae88b38e..72b58e56483 100644
--- a/Content.Client/Stylesheets/CommonStylesheet.cs
+++ b/Content.Client/Stylesheets/CommonStylesheet.cs
@@ -6,7 +6,7 @@ namespace Content.Client.Stylesheets;
public abstract class CommonStylesheet : PalettedStylesheet, IButtonConfig, IWindowConfig, IIconConfig, ITabContainerConfig,
ISliderConfig, IRadialMenuConfig, IPlaceholderConfig, ITooltipConfig, IPanelConfig, INanoHeadingConfig,
- ILineEditConfig, IStripebackConfig, ICheckboxConfig
+ ILineEditConfig, IStripebackConfig, ICheckboxConfig, ISwitchButtonConfig
{
///
/// This constructor will not access any virtual or abstract properties, so you can set them from your config.
@@ -73,4 +73,11 @@ public abstract class CommonStylesheet : PalettedStylesheet, IButtonConfig, IWin
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");
}
diff --git a/Content.Client/Stylesheets/SheetletConfigs/ISwitchButtonConfig.cs b/Content.Client/Stylesheets/SheetletConfigs/ISwitchButtonConfig.cs
new file mode 100644
index 00000000000..0697bc96263
--- /dev/null
+++ b/Content.Client/Stylesheets/SheetletConfigs/ISwitchButtonConfig.cs
@@ -0,0 +1,14 @@
+using Robust.Shared.Utility;
+
+namespace Content.Client.Stylesheets.SheetletConfigs;
+
+public interface ISwitchButtonConfig
+{
+ public ResPath SwitchButtonTrackFillPath { get; }
+ public ResPath SwitchButtonTrackOutlinePath { get; }
+ public ResPath SwitchButtonThumbFillPath { get; }
+ public ResPath SwitchButtonThumbOutlinePath { get; }
+ public ResPath SwitchButtonSymbolOffPath { get; }
+ public ResPath SwitchButtonSymbolOnPath { get; }
+}
+
diff --git a/Content.Client/Stylesheets/Sheetlets/SwitchButtonSheetlet.cs b/Content.Client/Stylesheets/Sheetlets/SwitchButtonSheetlet.cs
new file mode 100644
index 00000000000..fea92419505
--- /dev/null
+++ b/Content.Client/Stylesheets/Sheetlets/SwitchButtonSheetlet.cs
@@ -0,0 +1,125 @@
+using Content.Client.Stylesheets.SheetletConfigs;
+using Content.Client.Stylesheets.Stylesheets;
+using Content.Client.UserInterface.Controls;
+using Robust.Client.UserInterface;
+using Robust.Client.UserInterface.Controls;
+using static Content.Client.Stylesheets.StylesheetHelpers;
+
+namespace Content.Client.Stylesheets.Sheetlets;
+
+[CommonSheetlet]
+public sealed class SwitchButtonSheetlet : Sheetlet where T : PalettedStylesheet, ISwitchButtonConfig
+{
+ public override StyleRule[] GetRules(T sheet, object config)
+ {
+ ISwitchButtonConfig switchButtonCfg = sheet;
+
+ var trackFillTex = sheet.GetTextureOr(switchButtonCfg.SwitchButtonTrackFillPath, NanotrasenStylesheet.TextureRoot);
+ var trackOutlineTex = sheet.GetTextureOr(switchButtonCfg.SwitchButtonTrackOutlinePath, NanotrasenStylesheet.TextureRoot);
+ var thumbFillTex = sheet.GetTextureOr(switchButtonCfg.SwitchButtonThumbFillPath, NanotrasenStylesheet.TextureRoot);
+ var thumbOutlineTex = sheet.GetTextureOr(switchButtonCfg.SwitchButtonThumbOutlinePath, NanotrasenStylesheet.TextureRoot);
+ var symbolOffTex = sheet.GetTextureOr(switchButtonCfg.SwitchButtonSymbolOffPath, NanotrasenStylesheet.TextureRoot);
+ var symbolOnTex = sheet.GetTextureOr(switchButtonCfg.SwitchButtonSymbolOnPath, NanotrasenStylesheet.TextureRoot);
+
+ return
+ [
+ // SwitchButton
+ E().Prop(SwitchButton.StylePropertySeparation, 10),
+
+ E()
+ .ParentOf(E().Class(SwitchButton.StyleClassTrackFill))
+ .Prop(TextureRect.StylePropertyTexture, trackFillTex)
+ .Modulate(sheet.SecondaryPalette.BackgroundDark),
+
+ E()
+ .ParentOf(E().Class(SwitchButton.StyleClassTrackOutline))
+ .Prop(TextureRect.StylePropertyTexture, trackOutlineTex)
+ .Modulate(sheet.SecondaryPalette.Text),
+
+ E()
+ .ParentOf(E().Class(SwitchButton.StyleClassThumbFill))
+ .Prop(TextureRect.StylePropertyTexture, thumbFillTex)
+ .Modulate(sheet.PrimaryPalette.Element)
+ .HorizontalAlignment(Control.HAlignment.Left),
+
+ E()
+ .ParentOf(E().Class(SwitchButton.StyleClassThumbOutline))
+ .Prop(TextureRect.StylePropertyTexture, thumbOutlineTex)
+ .Modulate(sheet.PrimaryPalette.Text)
+ .HorizontalAlignment(Control.HAlignment.Left),
+
+ E()
+ .ParentOf(E().Class(SwitchButton.StyleClassSymbol))
+ .Prop(TextureRect.StylePropertyTexture, symbolOffTex)
+ .Modulate(sheet.SecondaryPalette.Text),
+
+ // Pressed styles
+ E()
+ .PseudoPressed()
+ .ParentOf(E().Class(SwitchButton.StyleClassTrackFill))
+ .Modulate(sheet.PositivePalette.Text),
+
+ E()
+ .PseudoPressed()
+ .ParentOf(E().Class(SwitchButton.StyleClassSymbol))
+ .Prop(TextureRect.StylePropertyTexture, symbolOnTex)
+ .Modulate(Color.White), // Same color as text, not yet in any of the palettes
+
+ E()
+ .PseudoPressed()
+ .ParentOf(E().Class(SwitchButton.StyleClassThumbFill))
+ .HorizontalAlignment(Control.HAlignment.Right),
+
+ E()
+ .PseudoPressed()
+ .ParentOf(E().Class(SwitchButton.StyleClassThumbOutline))
+ .HorizontalAlignment(Control.HAlignment.Right),
+
+ // Disabled styles
+ E()
+ .PseudoDisabled()
+ .ParentOf(E().Class(SwitchButton.StyleClassTrackFill))
+ .Modulate(sheet.SecondaryPalette.DisabledElement),
+
+ E()
+ .PseudoDisabled()
+ .ParentOf(E().Class(SwitchButton.StyleClassTrackOutline))
+ .Modulate(sheet.SecondaryPalette.DisabledElement),
+
+ E()
+ .PseudoDisabled()
+ .ParentOf(E().Class(SwitchButton.StyleClassThumbFill))
+ .Modulate(sheet.PrimaryPalette.DisabledElement),
+
+ E()
+ .PseudoDisabled()
+ .ParentOf(E().Class(SwitchButton.StyleClassThumbOutline))
+ .Modulate(sheet.PrimaryPalette.TextDark),
+
+ E()
+ .PseudoDisabled()
+ .ParentOf(E().Class(SwitchButton.StyleClassSymbol))
+ .Modulate(sheet.SecondaryPalette.TextDark),
+
+ E()
+ .PseudoDisabled()
+ .ParentOf(E