Fix separated game screen bumping (#33046)
I don't really understand why RecordedSplitContainer exists but removing it looks identical and fixes the panel bumping occasionally.
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
using System.Numerics;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
namespace Content.Client.UserInterface.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// A split container that performs an action when the split resizing is finished.
|
||||
/// </summary>
|
||||
public sealed class RecordedSplitContainer : SplitContainer
|
||||
{
|
||||
public double? DesiredSplitCenter;
|
||||
|
||||
protected override Vector2 ArrangeOverride(Vector2 finalSize)
|
||||
{
|
||||
if (ResizeMode == SplitResizeMode.RespectChildrenMinSize
|
||||
&& DesiredSplitCenter != null
|
||||
&& !finalSize.Equals(Vector2.Zero))
|
||||
{
|
||||
SplitFraction = (float) DesiredSplitCenter.Value;
|
||||
|
||||
if (!Size.Equals(Vector2.Zero))
|
||||
{
|
||||
DesiredSplitCenter = null;
|
||||
}
|
||||
}
|
||||
|
||||
return base.ArrangeOverride(finalSize);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
VerticalExpand="False"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Center">
|
||||
<controls:RecordedSplitContainer Name="ScreenContainer" HorizontalExpand="True" VerticalExpand="True" SplitWidth="0" StretchDirection="TopLeft">
|
||||
<SplitContainer Name="ScreenContainer" HorizontalExpand="True" VerticalExpand="True" SplitWidth="0" StretchDirection="TopLeft">
|
||||
<LayoutContainer Name="ViewportContainer" HorizontalExpand="True" VerticalExpand="True">
|
||||
<controls:MainViewport Name="MainViewport"/>
|
||||
<widgets:GhostGui Name="Ghost" Access="Protected" />
|
||||
@@ -26,7 +26,7 @@
|
||||
</BoxContainer>
|
||||
<alerts:AlertsUI Name="Alerts" Access="Protected" />
|
||||
</LayoutContainer>
|
||||
<PanelContainer HorizontalExpand="True" MinWidth="300">
|
||||
<PanelContainer Name="SeparatedChatPanel" MinWidth="300">
|
||||
<PanelContainer.PanelOverride>
|
||||
<graphics:StyleBoxFlat BackgroundColor="#2B2C3B" />
|
||||
</PanelContainer.PanelOverride>
|
||||
@@ -36,5 +36,5 @@
|
||||
<chat:ChatBox VerticalExpand="True" HorizontalExpand="True" Name="Chat" Access="Protected" MinSize="0 0"/>
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
</controls:RecordedSplitContainer>
|
||||
</SplitContainer>
|
||||
</screens:SeparatedChatGameScreen>
|
||||
|
||||
@@ -40,7 +40,6 @@ public sealed partial class SeparatedChatGameScreen : InGameScreen
|
||||
|
||||
public override void SetChatSize(Vector2 size)
|
||||
{
|
||||
ScreenContainer.DesiredSplitCenter = size.X;
|
||||
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user