]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Better PowerCharge menu wrapping (retry) (#34036)
authorc4llv07e <igor@c4llv07e.xyz>
Sat, 19 Apr 2025 20:20:32 +0000 (23:20 +0300)
committerGitHub <noreply@github.com>
Sat, 19 Apr 2025 20:20:32 +0000 (16:20 -0400)
* fixed

* Move wattage to the power button

---------

Co-authored-by: VideoKompany <135313844+VlaDOS1408@users.noreply.github.com>
Content.Client/Power/PowerCharge/PowerChargeWindow.xaml

index 4e61255326ef3621aa1471532e5bbc85d57cdbb3..982b75117a7bda78d9a74c412d11bfb2c29b51ef 100644 (file)
@@ -1,33 +1,88 @@
-<controls:FancyWindow xmlns="https://spacestation14.io"
-                xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
-                MinSize="270 130"
-                SetSize="360 180">
-    <BoxContainer Margin="4 0" Orientation="Horizontal">
-        <BoxContainer Orientation="Vertical" HorizontalExpand="True">
-            <GridContainer Margin="2 0 0 0" Columns="2">
+<controls:FancyWindow
+    xmlns="https://spacestation14.io"
+    xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
+    MinSize="320 180"
+    Resizable="False">
+    <BoxContainer
+        Margin="12 8"
+        Orientation="Horizontal"
+        SeparationOverride="12">
+        <BoxContainer
+            Orientation="Vertical"
+            HorizontalExpand="True">
+            <GridContainer
+                Columns="2"
+                VerticalAlignment="Center">
+
                 <!-- Power -->
-                <Label Text="{Loc 'power-charge-window-power'}" HorizontalExpand="True" StyleClasses="StatusFieldTitle" />
-                <BoxContainer Orientation="Horizontal" MinWidth="120">
-                    <Button Name="OnButton" Text="{Loc 'power-charge-window-power-on'}" StyleClasses="OpenRight" />
-                    <Button Name="OffButton" Text="{Loc 'power-charge-window-power-off'}" StyleClasses="OpenLeft" />
+                <Label
+                    Text="{Loc 'power-charge-window-power'}"
+                    HorizontalExpand="True"
+                    StyleClasses="StatusFieldTitle" />
+
+                <BoxContainer
+                    Orientation="Horizontal"
+                    MinWidth="120"
+                    SetWidth="160">
+
+                    <Button Name="OnButton"
+                        Text="{Loc 'power-charge-window-power-on'}"
+                        StyleClasses="OpenRight"
+                        MinWidth="60"
+                        SetWidth="80"
+                        HorizontalAlignment="Center"/>
+
+                    <Button
+                        Name="OffButton"
+                        Text="{Loc 'power-charge-window-power-off'}"
+                        StyleClasses="OpenLeft"
+                        MinWidth="60"
+                        SetWidth="80"
+                        HorizontalAlignment="Center"/>
                 </BoxContainer>
+
                 <Control /> <!-- Empty control to act as a spacer in the grid. -->
-                <Label Name="PowerLabel" Text="0 / 0 W" />
+
+                <Label Name="PowerLabel"
+                    Text="0 / 0 W" />
+
                 <!-- Status -->
-                <Label Text="{Loc 'power-charge-window-status'}"  StyleClasses="StatusFieldTitle" />
-                <Label Name="StatusLabel" Text="{Loc 'power-charge-window-status-fully-charged'}" />
+                <Label
+                    Text="{Loc 'power-charge-window-status'}"
+                    StyleClasses="StatusFieldTitle" />
+                <Label Name="StatusLabel"
+                    Text="{Loc 'power-charge-window-status-fully-charged'}" />
+
                 <!-- ETA -->
-                <Label Text="{Loc 'power-charge-window-eta'}" StyleClasses="StatusFieldTitle" />
-                <Label Name="EtaLabel" Text="N/A" />
+                <Label
+                    Text="{Loc 'power-charge-window-eta'}"
+                    StyleClasses="StatusFieldTitle" />
+                <Label Name="EtaLabel"
+                    Text="N/A" />
+
                 <!-- Charge -->
-                <Label Text="{Loc 'power-charge-window-charge'}" StyleClasses="StatusFieldTitle" />
-                <ProgressBar Name="ChargeBar" MaxValue="255">
-                    <Label Name="ChargeText" Margin="4 0" Text="0 %" />
+                <Label
+                    Text="{Loc 'power-charge-window-charge'}"
+                    StyleClasses="StatusFieldTitle" />
+
+                <ProgressBar Name="ChargeBar"
+                    MaxValue="255">
+
+                    <Label Name="ChargeText"
+                        HorizontalAlignment="Center"
+                        Margin="4 0"
+                        Text="0 %" />
                 </ProgressBar>
             </GridContainer>
         </BoxContainer>
-        <PanelContainer Margin="12 0 0 0" StyleClasses="Inset" VerticalAlignment="Center">
-            <SpriteView Name="EntityView" SetSize="96 96" OverrideDirection="South" />
+        <PanelContainer
+            StyleClasses="Inset"
+            VerticalAlignment="Top">
+
+            <SpriteView Name="EntityView"
+                SetSize="96 96"
+                Margin="0 0 0 26"
+                OverrideDirection="South" />
         </PanelContainer>
     </BoxContainer>
 </controls:FancyWindow>