summaryrefslogtreecommitdiff
path: root/toolkit/gocui/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/gocui/common.go')
-rw-r--r--toolkit/gocui/common.go22
1 files changed, 11 insertions, 11 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