From 54d71a24b6eaa191b2777f6070de252fc26801a3 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Fri, 19 Jan 2024 22:07:42 -0500 Subject: add layout from Keitio --- gui/layout/layout.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gui/layout/layout.go (limited to 'gui/layout/layout.go') diff --git a/gui/layout/layout.go b/gui/layout/layout.go new file mode 100644 index 0000000..4d8e616 --- /dev/null +++ b/gui/layout/layout.go @@ -0,0 +1,20 @@ +package layout + +import ( + "image" +) + +// Layout represents any graphical layout +// +// Lay represents the way to divide space among your childs. +// It takes a parameter of how much space is available, +// and returns where exactly to put its childs. +// +// Intercept transforms an Env channel to another. +// This way the Layout can emit its own Events, re-emit previous ones, +// or even stop an event from propagating, think win.MoScroll. +// It can be a no-op. +type Layout interface { + Lay(image.Rectangle) []image.Rectangle + Intercepter +} -- cgit v1.2.3