Skip to content

Commit

Permalink
Add Flip method to SplitContainer (#5333)
Browse files Browse the repository at this point in the history
  • Loading branch information
metalgearsloth authored Aug 14, 2024
1 parent 4b12ff8 commit efa3e01
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Robust.Client/UserInterface/Controls/SplitContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,19 @@ public SplitContainer()
_splitDragArea.OnMouseMove += OnMove;
}

/// <summary>
/// Swaps the position of the first and zeroeth children; for a 2-control viewport it effectively flips them.
/// </summary>
public void Flip()
{
if (ChildCount < 3)
return;

DebugTools.Assert(ChildCount <= 3);
GetChild(1).SetPositionFirst();
InvalidateArrange();
}

private void OnMove(GUIMouseMoveEventArgs args)
{
if (ResizeMode == SplitResizeMode.NotResizable)
Expand Down

0 comments on commit efa3e01

Please sign in to comment.