summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-05 11:27:12 -0600
committerJeff Carr <[email protected]>2025-02-05 11:27:12 -0600
commitae339cc587c57dfbe3263ad017258cfe8e7bfbc8 (patch)
tree8656a38274011d26af19bd3ffe4ed8ef92661a84
parent38a08d66fc8b49a33c749c6baeb7cd2860630c73 (diff)
have to fix gocui label sizes elsewhere
-rw-r--r--find.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/find.go b/find.go
index d423151..3c76755 100644
--- a/find.go
+++ b/find.go
@@ -121,8 +121,10 @@ func (tk *guiWidget) gridFullSize() rectType {
r.w1 = cr.w1
r.h1 = cr.h1
first = false
+ child.dumpWidget(fmt.Sprintf("grid(f)"))
continue
}
+ child.dumpWidget(fmt.Sprintf("grid()"))
// use the lowest width and hight from children widgets
if r.w0 > cr.w0 {
r.w0 = cr.w0
@@ -138,6 +140,26 @@ func (tk *guiWidget) gridFullSize() rectType {
r.h1 = cr.h1
}
}
+ tk.full.w0 = r.w0
+ tk.full.w1 = r.w1
+ tk.full.h0 = r.h0
+ tk.full.h1 = r.h1
+ return r
+}
+
+func (tk *guiWidget) buttonFullSize() rectType {
+ var r rectType
+ r.w0 = tk.gocuiSize.w0
+ r.w1 = tk.gocuiSize.w1
+ r.h0 = tk.gocuiSize.h0
+ r.h1 = tk.gocuiSize.h1
+
+ // try setting the full values here ? is this right?
+ tk.full.w0 = r.w0
+ tk.full.w1 = r.w1
+ tk.full.h0 = r.h0
+ tk.full.h1 = r.h1
+
return r
}
@@ -150,6 +172,20 @@ func (tk *guiWidget) getFullSize() rectType {
return tk.gridFullSize()
}
+ // these are 'simple' widgets
+ // the full size is exactly what gocui uses
+ switch tk.node.WidgetType {
+ case widget.Label:
+ return tk.buttonFullSize()
+ case widget.Button:
+ return tk.buttonFullSize()
+ case widget.Checkbox:
+ return tk.buttonFullSize()
+ case widget.Dropdown:
+ return tk.buttonFullSize()
+ default:
+ }
+
if tk.v == nil {
r.w0 = tk.full.w0
r.w1 = tk.full.w1