diff options
| author | Jeff Carr <[email protected]> | 2025-02-08 13:57:31 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-08 13:57:31 -0600 |
| commit | 5827b9ace289a645be2189c12865f05f59a25fca (patch) | |
| tree | a7e127192f41f5588a29bab43850c6932c360e74 /size.go | |
| parent | c4f9bac85eeafb4916b57d6f8953fa930d6d098e (diff) | |
buttons in dense mode line up correctly
Diffstat (limited to 'size.go')
| -rw-r--r-- | size.go | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 } |
