From aa779fb0b155f27015fd02e5a0f247c5175503ed Mon Sep 17 00:00:00 2001 From: Graham Clark Date: Fri, 3 Sep 2021 16:47:16 -0400 Subject: [PATCH] Render the columns dialog more nicely when terminal is narrow It looks ugly when the dialog headers are wrapped to the next line. --- ui/psmlcolsmodel.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/psmlcolsmodel.go b/ui/psmlcolsmodel.go index e4be28d..88a627e 100644 --- a/ui/psmlcolsmodel.go +++ b/ui/psmlcolsmodel.go @@ -21,6 +21,7 @@ import ( "github.com/gcla/gowid/widgets/styled" "github.com/gcla/gowid/widgets/table" "github.com/gcla/gowid/widgets/text" + "github.com/gcla/gowid/widgets/vpadding" "github.com/gcla/termshark/v2/shark" "github.com/gcla/termshark/v2/shark/wiresharkcfg" "github.com/gcla/termshark/v2/widgets/filter" @@ -508,7 +509,11 @@ func (p *psmlColumnsModel) HeaderWidgets() []gowid.IWidget { pr := gowid.MakePaletteRef("dialog") st := func(w gowid.IWidget) gowid.IWidget { - return styled.NewExt(w, gowid.ColorInverter{pr}, gowid.ColorInverter{pr}) + return vpadding.New( + styled.NewExt(w, gowid.ColorInverter{pr}, gowid.ColorInverter{pr}), + gowid.VAlignTop{}, + gowid.RenderWithUnits{U: 1}, + ) } if !p.haveCustom {