UI helper for the editor's arch opening drag tools. Renders a grid of toggle options and binds them to properties on an ArchOpeningDrag instance.
using Editor;
namespace Sunless.Architecture;
// The drag options both opening tools share, laid out once so the two sidebars cannot drift apart.
public static class ArchOpeningDragUi
{
public static void DragOptions( Layout group, ArchOpeningDrag drag )
{
using var grid = ArchIconGrid.In( group );
grid.Toggle( "Keep the sill aligned while dragging", "opt_restrict_start_height", "vertical_align_bottom",
drag.RestrictStartHeight, value => drag.RestrictStartHeight = value );
grid.Toggle( "Keep the head aligned while dragging", "opt_restrict_end_height", "vertical_align_top",
drag.RestrictEndHeight, value => drag.RestrictEndHeight = value );
grid.Toggle( "Leave a margin at the walls on either side", "opt_pad_sides", "width_normal",
drag.PadSides, value => drag.PadSides = value );
grid.Toggle( "Stop the head under the cornice inside", "opt_clear_cornice", "border_top",
drag.ClearCornice, value => drag.ClearCornice = value );
}
}