Introduce new layouts.Grid construct
This commit is contained in:
@@ -18,12 +18,18 @@ type Grid struct {
|
||||
// will contract. Boxes are laid out left to right, then top to bottom. Boxes
|
||||
// that go beyond the lengh of rows will be laid out according to columns, but
|
||||
// they will not expand vertically.
|
||||
func NewGrid (columns, rows []bool) *Grid {
|
||||
this := &Grid {
|
||||
xExpand: columns,
|
||||
yExpand: rows,
|
||||
//
|
||||
// If you aren't sure how to use this constructor, here is an example:
|
||||
//
|
||||
// X0 X1 X2 Y0 Y1 Y2
|
||||
// NewGrid(true, false, true)(false, true, true)
|
||||
func NewGrid (columns ...bool) func (rows ...bool) *Grid {
|
||||
return func (rows ...bool) *Grid {
|
||||
return &Grid {
|
||||
xExpand: columns,
|
||||
yExpand: rows,
|
||||
}
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *Grid) MinimumSize (hints tomo.LayoutHints, boxes []tomo.Box) image.Point {
|
||||
|
||||
Reference in New Issue
Block a user