summary refs log tree commit diff stats
path: root/cmd
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-17 19:42:29 -0500
committerDrew DeVault <sir@cmpwn.com>2018-02-17 19:42:29 -0500
commit5b2e3a0ca0b549c569ff6c01549c2dc425b0ba40 (patch)
tree7ac92fe8cb13e662aeeb851c3a9a945bf837f600 /cmd
parent60b351b78c930110716b0c9db2227e13704f826d (diff)
downloadaerc-5b2e3a0ca0b549c569ff6c01549c2dc425b0ba40.tar.gz
Implement tab container
Diffstat (limited to 'cmd')
-rw-r--r--cmd/aerc/main.go15
1 files changed, 12 insertions, 3 deletions
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)