summaryrefslogtreecommitdiff
path: root/toolkit/gocui/tab.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-05 19:03:01 -0500
committerJeff Carr <[email protected]>2023-04-05 19:03:01 -0500
commitf0052b9af8273feb852ba5bdfc3efb3673ff329e (patch)
tree2232abff613b3894f25746c26846f042c095bbc4 /toolkit/gocui/tab.go
parent56c45d93e435e1ab121cf2fad26e48312fff9244 (diff)
gocui: close to fixing tab coords
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/tab.go')
-rw-r--r--toolkit/gocui/tab.go22
1 files changed, 9 insertions, 13 deletions
diff --git a/toolkit/gocui/tab.go b/toolkit/gocui/tab.go
index bd56545..088577b 100644
--- a/toolkit/gocui/tab.go
+++ b/toolkit/gocui/tab.go
@@ -51,31 +51,27 @@ func (w *cuiWidget) showWidgets() {
func (w *cuiWidget) setTabWH() {
t := len(w.text)
- w.realWidth = t + me.buttonPadding
- w.realHeight = me.defaultHeight
+ w.gocuiSize.width = t + me.buttonPadding
+ w.gocuiSize.height = me.defaultHeight
- startW := 1
- startH := 1
+ w.gocuiSize.startW = me.rootNode.startW
+ w.gocuiSize.startH = me.rootNode.startH
for _, child := range me.rootNode.children {
if (child.isFake) {
continue
}
if (w == child) {
- w.startW = startW
- w.startH = startH
- w.gocuiSize.startW = startW
- w.gocuiSize.startH = startH
w.setWH()
w.showWidgetPlacement(logNow, "setTABWH:")
return
}
- startW += child.realWidth
+ w.gocuiSize.startW += child.realWidth
}
- w.startW = startW
- w.startH = startH
- w.gocuiSize.startW = startW
- w.gocuiSize.startH = startH
+
+ w.startW = me.rootNode.startW
+ w.startH = me.rootNode.startH + me.buttonPadding
+
w.setWH()
w.showWidgetPlacement(logNow, "setTabWH:")
}