summaryrefslogtreecommitdiff
path: root/size.go
diff options
context:
space:
mode:
Diffstat (limited to 'size.go')
-rw-r--r--size.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/size.go b/size.go
index 47af74d..91b6f81 100644
--- a/size.go
+++ b/size.go
@@ -79,6 +79,11 @@ func (tk *guiWidget) Size() (int, int) {
return len(tk.String()) + 10, 3 // TODO: compute this based on 'window dense'
case widget.Checkbox:
return len(tk.String()) + 2, 3 // TODO: compute this based on 'window dense'
+ case widget.Button:
+ if tk.isWindowDense() {
+ return len(tk.String()) + 2, 0
+ }
+ return len(tk.String()) + 2, 3 // TODO: compute this based on 'window dense'
}
if tk.isFake {
return 0, 0
@@ -249,6 +254,14 @@ func (tk *guiWidget) setFullSize() bool {
tk.full.h1 = r.h1
changed = true
}
+ if tk.node.WidgetType == widget.Button {
+ tk.full.h1 = tk.full.h0 + 1
+ }
+ if tk.isWindowDense() && tk.isInGrid() {
+ // if tk.full.Height() > 0 {
+ tk.full.h1 = tk.full.h0
+ // }
+ }
if changed {
tk.dumpWidget(fmt.Sprintf("setFullSize(changed)"))
}
@@ -310,6 +323,12 @@ func (tk *guiWidget) buttonFullSize() rectType {
tk.full.h0 = r.h0
tk.full.h1 = r.h1
+ // total hack. fix this somewhere eventually correctly
+ if tk.isWindowDense() { // total hack. fix this somewhere eventually correctly
+ tk.full.h0 += 1 // total hack. fix this somewhere eventually correctly
+ tk.full.h1 = tk.full.h0 // total hack. fix this somewhere eventually correctly
+ }
+
return r
}