Implemented Grid halign Center.
This commit is contained in:
parent
91e35c1610
commit
dcb505fd01
2
grid.go
2
grid.go
|
@ -251,7 +251,7 @@ func (g *grid) allocate(x int, y int, width int, height int, d *sizing) (allocat
|
||||||
case LeftTop:
|
case LeftTop:
|
||||||
// do nothing; this is the default
|
// do nothing; this is the default
|
||||||
case Center:
|
case Center:
|
||||||
// TODO
|
cell.xoff = (colwidths[cell.gridx] - cell.width) / 2
|
||||||
case RightBottom:
|
case RightBottom:
|
||||||
cell.xoff = colwidths[cell.gridx] - cell.width
|
cell.xoff = colwidths[cell.gridx] - cell.width
|
||||||
case Fill:
|
case Fill:
|
||||||
|
|
|
@ -49,7 +49,7 @@ func newRepainter(times int) *repainter {
|
||||||
grid.Add(r.repaint, nil, East, false, 0, false, LeftTop)
|
grid.Add(r.repaint, nil, East, false, 0, false, LeftTop)
|
||||||
grid.Add(r.width, r.x, South, true, Fill, false, LeftTop)
|
grid.Add(r.width, r.x, South, true, Fill, false, LeftTop)
|
||||||
grid.Add(r.height, nil, East, true, Fill, false, LeftTop)
|
grid.Add(r.height, nil, East, true, Fill, false, LeftTop)
|
||||||
grid.Add(r.all, nil, East, false, RightBottom, false, LeftTop)
|
grid.Add(r.all, nil, East, false, Center, false, LeftTop)
|
||||||
r.stack = NewVerticalStack(r.area, grid)
|
r.stack = NewVerticalStack(r.area, grid)
|
||||||
r.stack.SetStretchy(0)
|
r.stack.SetStretchy(0)
|
||||||
return r
|
return r
|
||||||
|
|
Loading…
Reference in New Issue