summary refs log tree commit diff stats
path: root/lib/ui/fill.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-27 21:17:26 -0500
committerDrew DeVault <sir@cmpwn.com>2018-02-27 21:17:26 -0500
commitcab3771e17286788913255a6abe858b476166837 (patch)
tree85c626c779e380bb6a9d7ddd6cba69ef33cf919d /lib/ui/fill.go
parenta073d7613fac7c79b7909d93a0dd7bfea05d5c9d (diff)
downloadaerc-cab3771e17286788913255a6abe858b476166837.tar.gz
Pull main aerc UI into widget
Diffstat (limited to 'lib/ui/fill.go')
-rw-r--r--lib/ui/fill.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/ui/fill.go b/lib/ui/fill.go
new file mode 100644
index 0000000..3c6f0a5
--- /dev/null
+++ b/lib/ui/fill.go
@@ -0,0 +1,27 @@
+package ui
+
+import (
+	tb "github.com/nsf/termbox-go"
+)
+
+type Fill rune
+
+func NewFill(f rune) Fill {
+	return Fill(f)
+}
+
+func (f Fill) Draw(ctx *Context) {
+	for x := 0; x < ctx.Width(); x += 1 {
+		for y := 0; y < ctx.Height(); y += 1 {
+			ctx.SetCell(x, y, rune(f), tb.ColorDefault, tb.ColorDefault)
+		}
+	}
+}
+
+func (f Fill) OnInvalidate(callback func(d Drawable)) {
+	// no-op
+}
+
+func (f Fill) Invalidate() {
+	// no-op
+}
> 3 4 5 6 7 8 9 10 11 12 13 14 15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41