From 9efeaef8a8fe7752da798c0f4e85008369feb646 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 5 Jul 2023 04:21:17 -0400 Subject: [PATCH] Revised layout interface --- object.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/object.go b/object.go index 2d0187f..80712fc 100644 --- a/object.go +++ b/object.go @@ -179,9 +179,17 @@ type ContainerBox interface { SetLayout (Layout) } +// LayoutHints are passed to a layout to tell it how to arrange child boxes. +type LayoutHints struct { + Min image.Point + Max *image.Point + Gap image.Point +} + // Layout can be given to a ContainerBox to arrange child objects. type Layout interface { - Arrange (image.Rectangle, Gap, []Box) + MinimumSize (LayoutHints, []Box) image.Point + Arrange (LayoutHints, []Box) } // Window is an operating system window. It can contain one object.