mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-24 08:19:49 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
38 lines
859 B
C#
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;
|
|
}
|
|
}
|