diff options
Diffstat (limited to 'size.go')
| -rw-r--r-- | size.go | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -22,7 +22,9 @@ func (tk *guiWidget) Size() (int, int) { var maxH int = 0 var maxW int = 0 for _, child := range tk.children { - if tk.hidden { continue } + if tk.hidden { + continue + } sizeW, sizeH := child.Size() maxW += sizeW if sizeH > maxH { @@ -41,7 +43,9 @@ func (tk *guiWidget) Size() (int, int) { maxH := tk.gocuiSize.Height() for _, child := range tk.children { - if tk.hidden { continue } + if tk.hidden { + continue + } sizeW, sizeH := child.Size() // increment straight down @@ -59,11 +63,15 @@ func (tk *guiWidget) Size() (int, int) { } func (w *guiWidget) sizeGrid() (int, int) { - if w.hidden { return 0, 0 } + if w.hidden { + return 0, 0 + } // first compute the max sizes of the rows and columns for _, child := range w.children { - if w.hidden { continue } + if w.hidden { + continue + } sizeW, sizeH := child.Size() // set the child's realWidth, and grid offset @@ -91,12 +99,16 @@ func (w *guiWidget) sizeBox() (int, int) { if w.WidgetType != widget.Box { return 0, 0 } - if w.hidden { return 0, 0 } + if w.hidden { + return 0, 0 + } var maxW int = 0 var maxH int = 0 for _, child := range w.children { - if w.hidden {continue} + if w.hidden { + continue + } sizeW, sizeH := child.Size() if child.direction == widget.Horizontal { maxW += sizeW |
