diff options
| author | Jeff Carr <[email protected]> | 2024-01-17 23:39:03 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-17 23:39:03 -0600 |
| commit | a0baba0821441d9cf38f0b33fe12fb96925c6236 (patch) | |
| tree | 2aece2a890c66c36b08524e117753817078ee58c /gocui/place.go | |
| parent | bee272651ad38453aef27f098513f7be652c39bf (diff) | |
new paths
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gocui/place.go')
| -rw-r--r-- | gocui/place.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gocui/place.go b/gocui/place.go index 8780bbe..4bdcd42 100644 --- a/gocui/place.go +++ b/gocui/place.go @@ -3,12 +3,12 @@ package main import ( "strings" + "go.wit.com/lib/widget" "go.wit.com/log" - "go.wit.com/gui/widget" ) func (n *node) placeBox(startW int, startH int) { - if (n.WidgetType != widget.Box) { + if n.WidgetType != widget.Box { return } n.showWidgetPlacement(true, "boxS()") @@ -21,7 +21,7 @@ func (n *node) placeBox(startW int, startH int) { newR := child.realGocuiSize() w := newR.w1 - newR.w0 h := newR.h1 - newR.h0 - if (n.direction == widget.Horizontal) { + if n.direction == widget.Horizontal { log.Log(NOW, "BOX IS HORIZONTAL", n.progname, "newWH()", newW, newH, "child()", w, h, child.progname) // expand based on the child width newW += w @@ -39,10 +39,10 @@ func (n *node) placeBox(startW int, startH int) { } func (n *node) placeWidgets(startW int, startH int) { - if (n == nil) { + if n == nil { return } - if (me.rootNode == nil) { + if me.rootNode == nil { return } @@ -87,7 +87,7 @@ func (n *node) placeWidgets(startW int, startH int) { func (n *node) placeGrid(startW int, startH int) { w := n.tk n.showWidgetPlacement(true, "grid0:") - if (n.WidgetType != widget.Grid) { + if n.WidgetType != widget.Grid { return } @@ -98,10 +98,10 @@ func (n *node) placeGrid(startW int, startH int) { childH := newR.h1 - newR.h0 // set the child's realWidth, and grid offset - if (w.widths[child.AtW] < childW) { + if w.widths[child.AtW] < childW { w.widths[child.AtW] = childW } - if (w.heights[child.AtH] < childH) { + if w.heights[child.AtH] < childH { w.heights[child.AtH] = childH } // child.showWidgetPlacement(logInfo, "grid: ") @@ -114,12 +114,12 @@ func (n *node) placeGrid(startW int, startH int) { var totalW, totalH int for i, w := range w.widths { - if (i < child.AtW) { + if i < child.AtW { totalW += w } } for i, h := range w.heights { - if (i < child.AtH) { + if i < child.AtH { totalH += h } } @@ -137,7 +137,7 @@ func (n *node) placeGrid(startW int, startH int) { // computes the real, actual size of all the gocli objects in a widget func (n *node) realGocuiSize() *rectType { - var f func (n *node, r *rectType) + var f func(n *node, r *rectType) newR := new(rectType) // initialize the values to opposite newR.w0 = 80 @@ -153,7 +153,7 @@ func (n *node) realGocuiSize() *rectType { // expand the rectangle to the biggest thing displayed f = func(n *node, r *rectType) { newR := n.tk.gocuiSize - if ! n.tk.isFake { + if !n.tk.isFake { if r.w0 > newR.w0 { r.w0 = newR.w0 } @@ -179,7 +179,7 @@ func (n *node) textSize() (int, int) { var width, height int for _, s := range strings.Split(widget.GetString(n.value), "\n") { - if (width < len(s)) { + if width < len(s) { width = len(s) } height += 1 |
