Files
space-station-14/Content.Client/Power/APC/UI/ApcMenu.xaml
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

57 lines
3.0 KiB
XML

<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Name="APCMenu"
Title="{Loc 'apc-menu-title'}"
Resizable="False">
<BoxContainer Orientation="Vertical">
<BoxContainer Margin="0 5 10 10" Orientation="Vertical">
<BoxContainer Margin="0" Orientation="Horizontal">
<!-- Sprite View -->
<PanelContainer Margin="0" StyleClasses="BackgroundPanelDark" VerticalAlignment="Center">
<SpriteView Name="EntityView" Scale="2 2" SetSize="64 64" OverrideDirection="South" />
</PanelContainer>
<!-- Data -->
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<GridContainer Margin="10 0 0 0" Columns="2">
<!-- Power On/Off -->
<Label Text="{Loc 'apc-menu-breaker-label'}" HorizontalExpand="True"
StyleClasses="highlight" MinWidth="120"/>
<controls:SwitchButton Name="BreakerButton" MinWidth="150"/>
<!--Charging Status-->
<Label Text="{Loc 'apc-menu-external-label'}" StyleClasses="highlight" MinWidth="120" />
<Label Name="ExternalPowerStateLabel" Text="{Loc 'apc-menu-power-state-good'}" />
<!--Battery Power-->
<Label Text="{Loc 'apc-menu-power-label'}" StyleClasses="highlight" MinWidth="120" />
<Label Name="PowerLabel"/>
</GridContainer>
</BoxContainer>
</BoxContainer>
<!-- Charge Progress Bar-->
<ProgressBar Name="ChargeBar"
HorizontalExpand="True"
MinValue="0"
MaxValue="1"
MinHeight = "25"
Page="0"
Margin="10 10 0 0"
Value="0.5">
<Label Name="ChargePercentage" Margin="4 0" Text="0 %" />
</ProgressBar>
</BoxContainer>
<!-- Footer -->
<BoxContainer Orientation="Vertical">
<PanelContainer StyleClasses="LowDivider" />
<BoxContainer Orientation="Horizontal" Margin="10 2 5 0" VerticalAlignment="Bottom">
<Label Text="{Loc 'apc-menu-flavor-left'}" StyleClasses="WindowFooterText" />
<Label Text="{Loc 'apc-menu-flavor-right'}" StyleClasses="WindowFooterText"
HorizontalAlignment="Right" HorizontalExpand="True" Margin="0 0 5 0" />
<TextureRect StyleClasses="NTLogoDark" Stretch="KeepAspectCentered"
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</controls:FancyWindow>