Skip to content

Commit

Permalink
Render the columns dialog more nicely when terminal is narrow
Browse files Browse the repository at this point in the history
It looks ugly when the dialog headers are wrapped to the next line.
  • Loading branch information
gcla committed Sep 3, 2021
1 parent 2cbf22d commit aa779fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/psmlcolsmodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit aa779fb

Please sign in to comment.