Files
sbox-public/engine/Sandbox.Tools/Qt/Layout/VerticalLayout.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

38 lines
859 B
C#

using Native;
using Sandbox;
using System;
namespace Editor;
//
// garry:
//
// I wanted a layout that flowed from top to bottom with no springyness or stretching
// this kind of works but at the same time it kind of doesn't work. Theres weirdness when
// they're inside another layout, or another layout is inside them. I don't love it.
// So I'm commenting it out.
internal class VerticalLayout : Layout
{
internal Native.QVerticalLayout _verticalLayout;
internal VerticalLayout( Widget parent ) : base( Native.QVerticalLayout.Create( parent?._widget ?? default ) )
{
}
internal override void NativeInit( nint ptr )
{
base.NativeInit( ptr );
_verticalLayout = (Native.QVerticalLayout)ptr;
}
public override Layout Add( Layout layout )
{
Assert.IsValid( layout );
_verticalLayout.addItem( layout._layout );
return layout;
}
}