From 5ef1bd10213a8e6a8b96ed1ca67a91ceb7f026fd Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 29 Jan 2024 23:01:39 -0600 Subject: window widgets are being displayed Signed-off-by: Jeff Carr --- tab.go | 45 ++++++++++++++------------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) (limited to 'tab.go') diff --git a/tab.go b/tab.go index d73847d..3ab1ba4 100644 --- a/tab.go +++ b/tab.go @@ -49,41 +49,24 @@ func (tk *guiWidget) gocuiSetWH(sizeW, sizeH int) { } } -func redoWindows(nextW int, nextH int) { - wRoot := me.treeRoot.TK.(*guiWidget) - for _, win := range wRoot.children { - if win.node.WidgetType != widget.Window { +func (w *guiWidget) redoWindows(nextW int, nextH int) { + var startW int = nextW + var startH int = nextH + + for _, child := range w.children { + if child.node.WidgetType != widget.Window { continue } - var tabs bool - for _, child := range win.children { - if child.node.WidgetType == widget.Tab { - tabs = true - } - } - if tabs { - // window is tabs. Don't show it as a standard button - win.frame = false - win.hasTabs = true - } else { - win.frame = false - win.hasTabs = false - } - - win.gocuiSetWH(nextW, nextH) - win.deleteView() - win.showView() - /* - sizeW := win.Width() + me.WindowPadW - sizeH := win.Height() - nextW += sizeW - log.Log(NOW, "redoWindows() start nextW,H =", nextW, nextH, "gocuiSize.W,H =", sizeW, sizeH, win.String()) + child.frame = false + child.hasTabs = false - if win.hasTabs { - win.redoTabs(me.TabW, me.TabH) - } - */ + child.gocuiSetWH(nextW, nextH) + child.deleteView() + child.showView() + sizeW := child.gocuiSize.Width() + nextW += sizeW + 4 + child.redoWindows(startW + 3, startH + 2) } } -- cgit v1.2.3