aboutsummaryrefslogtreecommitdiffstats
path: root/layout/layout.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-08-17 14:05:07 -0400
committerSam Anthony <sam@samanthony.xyz>2024-08-17 14:05:07 -0400
commit32f1b20c3e93457dec949e7e426fd3ab17dc3d5c (patch)
tree201321e995e9f74cab877dac64e74eb654946f1b /layout/layout.go
parentee1ecb5c17ebe98d18dc62390ecb6c09f648a52e (diff)
parent8d183ef96a57e3a2f42c0cb4ec0ab4c256e0d47e (diff)
downloadgui-32f1b20c3e93457dec949e7e426fd3ab17dc3d5c.zip
Merge remote-tracking branch 'keitio/master'
layout
Diffstat (limited to 'layout/layout.go')
-rw-r--r--layout/layout.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/layout/layout.go b/layout/layout.go
new file mode 100644
index 0000000..4d8e616
--- /dev/null
+++ b/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
+}