diff --git a/colorNew.go b/colorNew.go index b7b908b..3357178 100644 --- a/colorNew.go +++ b/colorNew.go @@ -99,10 +99,10 @@ func (tk *guiWidget) setColorButtonDense() { return } tk.color.frame = gocui.AttrNone - tk.color.fg = gocui.ColorBlue - tk.color.bg = gocui.AttrNone - tk.color.selFg = gocui.ColorWhite - tk.color.selBg = gocui.ColorBlue + tk.color.fg = gocui.ColorWhite + tk.color.bg = gocui.ColorBlue + tk.color.selFg = gocui.ColorBlue + tk.color.selBg = gocui.AttrNone } func (tk *guiWidget) setColorButton() { diff --git a/place.go b/place.go index b9b18cd..7d74169 100644 --- a/place.go +++ b/place.go @@ -148,6 +148,9 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) { tk.color = nil tk.defaultColor = nil tk.setColorButtonDense() + // if tk.full.Height() > 0 { + tk.full.h1 = tk.full.h0 + // } } tk.gocuiSetWH(startW, startH) return tk.gocuiSize.Width(), tk.gocuiSize.Height() 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 }