From 5b2e3a0ca0b549c569ff6c01549c2dc425b0ba40 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 17 Feb 2018 19:42:29 -0500 Subject: Implement tab container --- cmd/aerc/main.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/aerc/main.go b/cmd/aerc/main.go index 1d11c5d..7a273b8 100644 --- a/cmd/aerc/main.go +++ b/cmd/aerc/main.go @@ -48,9 +48,13 @@ func main() { panic(err) } + tabs := ui.NewTabs() + tabs.Add(fill('★'), "白い星") + tabs.Add(fill('☆'), "empty stars") + grid := ui.NewGrid() grid.Rows = []ui.DimSpec{ - ui.DimSpec{ui.SIZE_EXACT, 4}, + ui.DimSpec{ui.SIZE_EXACT, 1}, ui.DimSpec{ui.SIZE_WEIGHT, 1}, ui.DimSpec{ui.SIZE_WEIGHT, 1}, ui.DimSpec{ui.SIZE_EXACT, 1}, @@ -59,8 +63,8 @@ func main() { ui.DimSpec{ui.SIZE_WEIGHT, 3}, ui.DimSpec{ui.SIZE_WEIGHT, 2}, } - grid.AddChild(fill('★')).At(0, 0).Span(1, 2) - grid.AddChild(fill('☆')).At(1, 0).Span(1, 2) + grid.AddChild(tabs.TabStrip).At(0, 0).Span(1, 2) + grid.AddChild(tabs.TabContent).At(1, 0).Span(1, 2) grid.AddChild(fill('.')).At(2, 0).Span(1, 2) grid.AddChild(fill('•')).At(2, 1).Span(1, 1) grid.AddChild(fill('+')).At(3, 0).Span(1, 2) @@ -71,6 +75,11 @@ func main() { } defer _ui.Close() + go (func() { + time.Sleep(1 * time.Second) + tabs.Select(1) + })() + for !_ui.Exit { if !_ui.Tick() { time.Sleep(100 * time.Millisecond) -- cgit 1.4.1-2-gfad0