aboutsummaryrefslogtreecommitdiffstats
path: root/examples/layout/card.go
blob: 501e4e3d4df9a399d5052d47c3acc007f48914e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import (
	"github.com/faiface/gui"
	"github.com/faiface/gui/layout"
	"golang.org/x/image/colornames"
)

func Card(env gui.Env, theme *Theme, title, content string) {
	box := layout.Grid{
		Rows: []int{1, 1},
		// Flip:       true,
		// Gap:        4,
		Background: colornames.Pink,
	}
	fields := makeEnvPtr(2)
	layout.NewMux(env,
		fields,
		box,
	)
	go Label(*fields[0], theme, title, colornames.Lightgray)
	go Label(*fields[1], theme, content, colornames.Slategray)
	// go Blinker(*fields[1])
}