]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add collapse button to lobby right panel (#37140)
authorB_Kirill <153602297+B-Kirill@users.noreply.github.com>
Tue, 6 May 2025 17:24:58 +0000 (03:24 +1000)
committerGitHub <noreply@github.com>
Tue, 6 May 2025 17:24:58 +0000 (13:24 -0400)
* Add collapse button to lobby right panel

* Half sized buttons

Content.Client/Lobby/UI/LobbyGui.xaml
Content.Client/Lobby/UI/LobbyGui.xaml.cs
Resources/Textures/Interface/Default/filled_left_arrow.svg [new file with mode: 0644]
Resources/Textures/Interface/Default/filled_left_arrow.svg.192dpi.png [new file with mode: 0644]
Resources/Textures/Interface/Default/filled_left_arrow.svg.192dpi.png.yml [new file with mode: 0644]
Resources/Textures/Interface/Default/filled_right_arrow.svg [new file with mode: 0644]
Resources/Textures/Interface/Default/filled_right_arrow.svg.192dpi.png [new file with mode: 0644]
Resources/Textures/Interface/Default/filled_right_arrow.svg.192dpi.png.yml [new file with mode: 0644]

index 615d8cb2711802e0f38d6847ffae2ee16fd9fb39..761795452e2849dfa65b9945681312034031fa0f 100644 (file)
                     <controls:HSpacer Spacing="10" />
                     <widgets:ChatBox Name="Chat" Access="Public" VerticalExpand="True" Margin="3 3 3 3" MinHeight="50" />
                 </BoxContainer>
+                <TextureButton Name="CollapseButton"
+                                TexturePath="filled_right_arrow.svg.192dpi"
+                                HorizontalAlignment="Right"
+                                VerticalAlignment="Top"
+                                Margin="0 2 2 0"
+                                ModulateSelfOverride="#DEDEDE"
+                                Scale="0.5 0.5"/>
             </PanelContainer>
         </SplitContainer>
+        <PanelContainer Name="ExpandPanel"
+                        StyleClasses="AngleRect" 
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Top"
+                        Margin="0 2 2 0"
+                        Visible="False">
+            <TextureButton Name="ExpandButton"
+                        TexturePath="filled_left_arrow.svg.192dpi"
+                        HorizontalAlignment="Center"
+                        VerticalAlignment="Center"
+                        ModulateSelfOverride="#DEDEDE"
+                        Scale="0.5 0.5"/>
+        </PanelContainer>
     </BoxContainer>
 </lobbyUi:LobbyGui>
index 6471edb6f3792cdade8a20a29084bd3d0b0d5961..61f9f5f64b9f105c7750a1c733153d76c70115c5 100644 (file)
@@ -23,6 +23,9 @@ namespace Content.Client.Lobby.UI
 
             LeaveButton.OnPressed += _ => _consoleHost.ExecuteCommand("disconnect");
             OptionsButton.OnPressed += _ => UserInterfaceManager.GetUIController<OptionsUIController>().ToggleWindow();
+
+            CollapseButton.OnPressed += _ => TogglePanel(false);
+            ExpandButton.OnPressed += _ => TogglePanel(true);
         }
 
         public void SwitchState(LobbyGuiState state)
@@ -53,6 +56,12 @@ namespace Content.Client.Lobby.UI
             }
         }
 
+        private void TogglePanel(bool value)
+        {
+            RightSide.Visible = value;
+            ExpandPanel.Visible = !value;
+        }
+
         public enum LobbyGuiState : byte
         {
             /// <summary>
diff --git a/Resources/Textures/Interface/Default/filled_left_arrow.svg b/Resources/Textures/Interface/Default/filled_left_arrow.svg
new file mode 100644 (file)
index 0000000..23c7ace
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg 
+   xmlns="http://www.w3.org/2000/svg"
+   width="12"
+   height="14"
+   viewBox="0 0 12 14">
+
+   <path 
+      fill="#7b7e9e" 
+      d="M0,7 L12,0 L12,14 L0,7 Z"/>
+</svg>
diff --git a/Resources/Textures/Interface/Default/filled_left_arrow.svg.192dpi.png b/Resources/Textures/Interface/Default/filled_left_arrow.svg.192dpi.png
new file mode 100644 (file)
index 0000000..02c05e3
Binary files /dev/null and b/Resources/Textures/Interface/Default/filled_left_arrow.svg.192dpi.png differ
diff --git a/Resources/Textures/Interface/Default/filled_left_arrow.svg.192dpi.png.yml b/Resources/Textures/Interface/Default/filled_left_arrow.svg.192dpi.png.yml
new file mode 100644 (file)
index 0000000..5c43e23
--- /dev/null
@@ -0,0 +1,2 @@
+sample:
+  filter: true
diff --git a/Resources/Textures/Interface/Default/filled_right_arrow.svg b/Resources/Textures/Interface/Default/filled_right_arrow.svg
new file mode 100644 (file)
index 0000000..5551942
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg 
+   xmlns="http://www.w3.org/2000/svg"
+   width="12"
+   height="14"
+   viewBox="0 0 12 14">
+
+   <path 
+      fill="#7b7e9e" 
+      d="M12,7 L0,0 L0,14 L12,7 Z"/>
+</svg>
diff --git a/Resources/Textures/Interface/Default/filled_right_arrow.svg.192dpi.png b/Resources/Textures/Interface/Default/filled_right_arrow.svg.192dpi.png
new file mode 100644 (file)
index 0000000..d5db044
Binary files /dev/null and b/Resources/Textures/Interface/Default/filled_right_arrow.svg.192dpi.png differ
diff --git a/Resources/Textures/Interface/Default/filled_right_arrow.svg.192dpi.png.yml b/Resources/Textures/Interface/Default/filled_right_arrow.svg.192dpi.png.yml
new file mode 100644 (file)
index 0000000..5c43e23
--- /dev/null
@@ -0,0 +1,2 @@
+sample:
+  filter: true