diff options
| -rw-r--r-- | add.go | 3 | ||||
| -rw-r--r-- | click.go | 3 | ||||
| -rw-r--r-- | keybindings.go | 6 | ||||
| -rw-r--r-- | plugin.go | 2 | ||||
| -rw-r--r-- | tab.go | 45 |
5 files changed, 23 insertions, 36 deletions
@@ -47,7 +47,8 @@ func addWidget(n *tree.Node) { case widget.Window: nw.frame = false nw.color = &colorWindow - // redoWindows(0,0) + wRoot := me.treeRoot.TK.(*guiWidget) + wRoot.redoWindows(0, 0) return case widget.Tab: nw.color = &colorTab @@ -95,7 +95,8 @@ func (w *guiWidget) doWidgetClick() { case widget.Root: // THIS IS THE BEGINING OF THE LAYOUT log.Log(NOW, "doWidgetClick()", w.String()) - redoWindows(0, 0) + wRoot := me.treeRoot.TK.(*guiWidget) + wRoot.redoWindows(0, 0) case widget.Flag: log.Log(NOW, "doWidgetClick() FLAG widget name =", w.String()) log.Log(NOW, "doWidgetClick() if this is the dropdown menu, handle it here?") diff --git a/keybindings.go b/keybindings.go index d570367..b513424 100644 --- a/keybindings.go +++ b/keybindings.go @@ -81,7 +81,8 @@ func addDebugKeys(g *gocui.Gui) { var w *guiWidget w = me.treeRoot.TK.(*guiWidget) if redoWidgets { - redoWindows(0, 0) + wRoot := me.treeRoot.TK.(*guiWidget) + wRoot.redoWindows(0, 0) redoWidgets = false } else { w.hideWidgets() @@ -126,7 +127,8 @@ func addDebugKeys(g *gocui.Gui) { // redo windows g.SetKeybinding("", 'w', gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { - redoWindows(0, 0) + wRoot := me.treeRoot.TK.(*guiWidget) + wRoot.redoWindows(0, 0) return nil }) @@ -8,7 +8,7 @@ import ( ) func action(a widget.Action) { - log.Log(INFO, "action() START", a.WidgetId, a.ActionType, a.WidgetType, a.ProgName) + log.Log(NOW, "action() START", a.WidgetId, a.ActionType, a.WidgetType, a.ProgName) // n := me.rootNode.findWidgetId(a.WidgetId) n := me.treeRoot.FindWidgetId(a.WidgetId) var w *guiWidget @@ -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) } } |
