summaryrefslogtreecommitdiff
path: root/click.go
diff options
context:
space:
mode:
Diffstat (limited to 'click.go')
-rw-r--r--click.go36
1 files changed, 29 insertions, 7 deletions
diff --git a/click.go b/click.go
index 169f007..874f8ce 100644
--- a/click.go
+++ b/click.go
@@ -101,6 +101,7 @@ func (w *guiWidget) doWidgetClick() {
log.Log(NOW, "doWidgetClick() if this is the dropdown menu, handle it here?")
case widget.Window:
log.Log(NOW, "doWidgetClick() START on window", w.String())
+ /*
if me.currentWindow == w.node {
return
}
@@ -111,13 +112,19 @@ func (w *guiWidget) doWidgetClick() {
curw.setColor(&colorWindow)
curw.hideWidgets()
}
+ */
me.currentWindow = w.node
log.Log(NOW, "doWidgetClick() set currentWindow to", w.String())
w.setColor(&colorActiveW)
- w.hideWidgets()
- w.placeWidgets(me.RawW, me.RawH)
- w.showWidgets()
+ if w.active {
+ w.active = false
+ w.placeWidgets(me.RawW, me.RawH)
+ w.showWidgets()
+ } else {
+ w.active = true
+ w.hideWidgets()
+ }
/*
w.redoTabs(me.TabW, me.TabH)
for _, child := range w.children {
@@ -158,7 +165,22 @@ func (w *guiWidget) doWidgetClick() {
w.showWidgets()
case widget.Group:
// n.placeWidgets(p.tk.startH, newH)
- w.toggleTree()
+ if w.active {
+ w.active = false
+ startW := me.RawW
+ startH := me.RawH
+ for _, child := range w.children {
+ log.Log(INFO, "START W,H", startW, startH)
+ child.placeWidgets(me.RawW, me.RawH)
+ child.showWidgets()
+ }
+ } else {
+ w.active = true
+ for _, child := range w.children {
+ child.hideWidgets()
+ }
+ }
+ w.dumpTree()
case widget.Checkbox:
if widget.GetBool(w.value) {
w.setCheckbox(false)
@@ -255,7 +277,7 @@ func (w *guiWidget) drawTree(draw bool) {
if w == nil {
return
}
- w.showWidgetPlacement(true, "drawTree()")
+ w.showWidgetPlacement("drawTree()")
if draw {
// w.textResize()
w.showView()
@@ -344,7 +366,7 @@ func findUnderMouse() *tree.Node {
for _, n := range widgets {
//log(logNow, "ctrlDown() FOUND widget", widget.id, widget.name)
widget := n.TK.(*guiWidget)
- widget.showWidgetPlacement(true, "findUnderMouse() FOUND")
+ widget.showWidgetPlacement("findUnderMouse() FOUND")
}
return found
}
@@ -381,6 +403,6 @@ func ctrlDown(g *gocui.Gui, v *gocui.View) error {
} else {
// me.ctrlDown.showView()
}
- // me.ctrlDown.showWidgetPlacement(true, "ctrlDown:")
+ // me.ctrlDown.showWidgetPlacement("ctrlDown:")
return nil
}