Add collapse button to lobby right panel (#37140)

* Add collapse button to lobby right panel

* Half sized buttons
This commit is contained in:
B_Kirill
2025-05-07 03:24:58 +10:00
committed by GitHub
parent 9b5ddb87f5
commit c156c5c465
8 changed files with 55 additions and 0 deletions

View File

@@ -100,7 +100,27 @@
<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>

View 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>

View File

@@ -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>

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,2 @@
sample:
filter: true

View File

@@ -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>

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,2 @@
sample:
filter: true