Revised layout interface

This commit is contained in:
Sasha Koshka 2023-07-05 04:21:17 -04:00
parent d6baf82a94
commit 9efeaef8a8
1 changed files with 9 additions and 1 deletions

View File

@ -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.