gocui: tabs functional now but not perfect

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-04-26 13:00:58 -05:00
parent e750b06831
commit d67c7b2635
2 changed files with 5 additions and 2 deletions

View File

@ -35,7 +35,6 @@ func (w *cuiWidget) doWidgetClick() {
me.rootNode.nextW = 0 me.rootNode.nextW = 0
me.rootNode.nextH = 0 me.rootNode.nextH = 0
me.rootNode.redoTabs(true)
w.isCurrent = true w.isCurrent = true
if w.hasTabs { if w.hasTabs {
@ -45,6 +44,7 @@ func (w *cuiWidget) doWidgetClick() {
break break
} }
} }
me.rootNode.redoTabs(true)
w.placeWidgets() w.placeWidgets()
w.showWidgets() w.showWidgets()

View File

@ -126,8 +126,11 @@ func (w *cuiWidget) redoTabs(draw bool) {
if (w.widgetType == toolkit.Tab) { if (w.widgetType == toolkit.Tab) {
w.setTabWH() w.setTabWH()
w.deleteView() w.deleteView()
// show all the tabs for the current window
if w.parent.isCurrent {
w.showView() w.showView()
} }
}
for _, child := range w.children { for _, child := range w.children {
child.redoTabs(draw) child.redoTabs(draw)