window widgets are being displayed
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
d97ce2aecc
commit
5ef1bd1021
3
add.go
3
add.go
|
@ -47,7 +47,8 @@ func addWidget(n *tree.Node) {
|
||||||
case widget.Window:
|
case widget.Window:
|
||||||
nw.frame = false
|
nw.frame = false
|
||||||
nw.color = &colorWindow
|
nw.color = &colorWindow
|
||||||
// redoWindows(0,0)
|
wRoot := me.treeRoot.TK.(*guiWidget)
|
||||||
|
wRoot.redoWindows(0, 0)
|
||||||
return
|
return
|
||||||
case widget.Tab:
|
case widget.Tab:
|
||||||
nw.color = &colorTab
|
nw.color = &colorTab
|
||||||
|
|
3
click.go
3
click.go
|
@ -95,7 +95,8 @@ func (w *guiWidget) doWidgetClick() {
|
||||||
case widget.Root:
|
case widget.Root:
|
||||||
// THIS IS THE BEGINING OF THE LAYOUT
|
// THIS IS THE BEGINING OF THE LAYOUT
|
||||||
log.Log(NOW, "doWidgetClick()", w.String())
|
log.Log(NOW, "doWidgetClick()", w.String())
|
||||||
redoWindows(0, 0)
|
wRoot := me.treeRoot.TK.(*guiWidget)
|
||||||
|
wRoot.redoWindows(0, 0)
|
||||||
case widget.Flag:
|
case widget.Flag:
|
||||||
log.Log(NOW, "doWidgetClick() FLAG widget name =", w.String())
|
log.Log(NOW, "doWidgetClick() FLAG widget name =", w.String())
|
||||||
log.Log(NOW, "doWidgetClick() if this is the dropdown menu, handle it here?")
|
log.Log(NOW, "doWidgetClick() if this is the dropdown menu, handle it here?")
|
||||||
|
|
|
@ -81,7 +81,8 @@ func addDebugKeys(g *gocui.Gui) {
|
||||||
var w *guiWidget
|
var w *guiWidget
|
||||||
w = me.treeRoot.TK.(*guiWidget)
|
w = me.treeRoot.TK.(*guiWidget)
|
||||||
if redoWidgets {
|
if redoWidgets {
|
||||||
redoWindows(0, 0)
|
wRoot := me.treeRoot.TK.(*guiWidget)
|
||||||
|
wRoot.redoWindows(0, 0)
|
||||||
redoWidgets = false
|
redoWidgets = false
|
||||||
} else {
|
} else {
|
||||||
w.hideWidgets()
|
w.hideWidgets()
|
||||||
|
@ -126,7 +127,8 @@ func addDebugKeys(g *gocui.Gui) {
|
||||||
// redo windows
|
// redo windows
|
||||||
g.SetKeybinding("", 'w', gocui.ModNone,
|
g.SetKeybinding("", 'w', gocui.ModNone,
|
||||||
func(g *gocui.Gui, v *gocui.View) error {
|
func(g *gocui.Gui, v *gocui.View) error {
|
||||||
redoWindows(0, 0)
|
wRoot := me.treeRoot.TK.(*guiWidget)
|
||||||
|
wRoot.redoWindows(0, 0)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func action(a widget.Action) {
|
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.rootNode.findWidgetId(a.WidgetId)
|
||||||
n := me.treeRoot.FindWidgetId(a.WidgetId)
|
n := me.treeRoot.FindWidgetId(a.WidgetId)
|
||||||
var w *guiWidget
|
var w *guiWidget
|
||||||
|
|
45
tab.go
45
tab.go
|
@ -49,41 +49,24 @@ func (tk *guiWidget) gocuiSetWH(sizeW, sizeH int) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func redoWindows(nextW int, nextH int) {
|
func (w *guiWidget) redoWindows(nextW int, nextH int) {
|
||||||
wRoot := me.treeRoot.TK.(*guiWidget)
|
var startW int = nextW
|
||||||
for _, win := range wRoot.children {
|
var startH int = nextH
|
||||||
if win.node.WidgetType != widget.Window {
|
|
||||||
|
for _, child := range w.children {
|
||||||
|
if child.node.WidgetType != widget.Window {
|
||||||
continue
|
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)
|
child.frame = false
|
||||||
win.deleteView()
|
child.hasTabs = false
|
||||||
win.showView()
|
|
||||||
|
|
||||||
/*
|
child.gocuiSetWH(nextW, nextH)
|
||||||
sizeW := win.Width() + me.WindowPadW
|
child.deleteView()
|
||||||
sizeH := win.Height()
|
child.showView()
|
||||||
nextW += sizeW
|
sizeW := child.gocuiSize.Width()
|
||||||
log.Log(NOW, "redoWindows() start nextW,H =", nextW, nextH, "gocuiSize.W,H =", sizeW, sizeH, win.String())
|
nextW += sizeW + 4
|
||||||
|
child.redoWindows(startW + 3, startH + 2)
|
||||||
if win.hasTabs {
|
|
||||||
win.redoTabs(me.TabW, me.TabH)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue