more on working windows

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-29 23:23:04 -06:00
parent 467b10d3f8
commit d58eee556c
1 changed files with 15 additions and 53 deletions

View File

@ -102,9 +102,11 @@ 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
// }
if me.currentWindow == w.node {
if ! w.active {
return
}
}
if me.currentWindow != nil {
var curw *guiWidget
curw = me.currentWindow.TK.(*guiWidget)
@ -116,56 +118,16 @@ func (w *guiWidget) doWidgetClick() {
log.Log(NOW, "doWidgetClick() set currentWindow to", w.String())
w.setColor(&colorActiveW)
if w.active {
w.active = false
w.dumpTree("before")
w.placeWidgets(3, 2)
w.showWidgets()
w.dumpTree("after")
} else {
w.active = true
w.hideWidgets()
}
/*
w.redoTabs(me.TabW, me.TabH)
for _, child := range w.children {
if child.currentTab == true {
log.Log(NOW, "FOUND CURRENT TAB", child.String())
child.setCurrentTab()
child.placeWidgets(me.RawW, me.RawH)
child.showWidgets()
return
}
}
*/
/* FIXME: redo this
if ! n.hasTabs {
}
*/
/*
case widget.Tab:
if w.IsCurrent() {
return // do nothing if you reclick on the already selected tab
}
// find the window and disable the active tab
p := w.parent
if p != nil {
p.hideWidgets()
p.redoTabs(me.TabW, me.TabH)
p.unsetCurrent()
for _, child := range w.children {
if child.WidgetType == widget.Tab {
child.setColor(&colorTab)
child.currentTab = false
}
}
}
w.currentTab = true
w.setColor(&colorActiveT)
w.setCurrentTab()
w.placeWidgets(me.RawW, me.RawH)
w.showWidgets()
*/
w.active = false
w.dumpTree("before")
w.placeWidgets(3, 2)
w.showWidgets()
w.hideFake()
showDebug = true
w.dumpTree("after")
case widget.Group:
// n.placeWidgets(p.tk.startH, newH)
w.dumpTree("click start")