summaryrefslogtreecommitdiff
path: root/toolkit/gocui
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/gocui')
-rw-r--r--toolkit/gocui/common.go22
-rw-r--r--toolkit/gocui/place.go7
-rw-r--r--toolkit/gocui/structs.go2
3 files changed, 16 insertions, 15 deletions
diff --git a/toolkit/gocui/common.go b/toolkit/gocui/common.go
index 09c58f0..9f10e94 100644
--- a/toolkit/gocui/common.go
+++ b/toolkit/gocui/common.go
@@ -17,27 +17,27 @@ func makeWidget(a *toolkit.Action) *cuiWidget {
w.s = a.S
w.x = a.X
w.y = a.Y
- w.width = a.Width
- w.height = a.Height
+
t := len(w.text)
- w.realWidth = t + me.buttonPadding
- w.realHeight = me.DefaultHeight
- w.gocuiSize.width = t + me.buttonPadding
- w.gocuiSize.height = me.DefaultHeight
+ w.gocuiSize.width = t + me.PadW
+ w.gocuiSize.height = me.DefaultHeight + me.PadH
+
+ w.realWidth = w.gocuiSize.width
+ w.realHeight = w.gocuiSize.height
- w.widgetType = a.WidgetType
- w.id = a.WidgetId
- // set the name used by gocui to the id
- w.cuiName = strconv.Itoa(w.id)
// set the gocui view.Frame = true by default
w.frame = true
-
if (w.frame) {
w.realHeight += me.FramePadH
w.gocuiSize.height += me.FramePadH
}
+ w.widgetType = a.WidgetType
+ w.id = a.WidgetId
+ // set the name used by gocui to the id
+ w.cuiName = strconv.Itoa(w.id)
+
if w.widgetType == toolkit.Root {
log(logInfo, "setupWidget() FOUND ROOT w.id =", w.id, "w.parent", w.parent, "ParentId =", a.ParentId)
w.id = 0
diff --git a/toolkit/gocui/place.go b/toolkit/gocui/place.go
index 2ff791a..50e3b6f 100644
--- a/toolkit/gocui/place.go
+++ b/toolkit/gocui/place.go
@@ -48,13 +48,13 @@ func (w *cuiWidget) placeBox() {
w.showWidgetPlacement(logNow, "boxE()")
}
+/*
func (w *cuiWidget) getGroupWH() {
p := w.parent // the parent must be a group widget
// update parent gocuiSize
- p.realWidth = 0
- p.realHeight = 0
- p.realHeight += me.buttonPadding // pad height for the group label
+ // p.realWidth =
+ // p.realHeight += me.DefaultHeight + me.PadH + me.FramePadH
for _, child := range p.children {
p.realWidth += child.realWidth
p.realHeight += child.realHeight
@@ -71,6 +71,7 @@ func (w *cuiWidget) getGroupWH() {
}
return
}
+*/
func (w *cuiWidget) placeWidgets() {
if (w == nil) {
diff --git a/toolkit/gocui/structs.go b/toolkit/gocui/structs.go
index 78ca36d..b3c780f 100644
--- a/toolkit/gocui/structs.go
+++ b/toolkit/gocui/structs.go
@@ -69,7 +69,7 @@ type config struct {
// horizontalPadding int
// groupPadding int `default:"6" dense:"2"` // this is supposed to be how far to indent to the left
- buttonPadding int `default:"4" dense:"3"` // if 3, buttons slightly overlap
+ // buttonPadding int `default:"4" dense:"3"` // if 3, buttons slightly overlap
}
var (