Skip to content

Commit

Permalink
feat: calculate last round table columns count on start based on scre…
Browse files Browse the repository at this point in the history
…en width
  • Loading branch information
freak12techno committed Oct 7, 2024
1 parent e763d05 commit 058cf87
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/display/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,12 @@ func (w *Wrapper) Start() {
_, _ = fmt.Fprint(w.ConsensusInfoTextView, "Loading...")
_, _ = fmt.Fprint(w.ProgressTextView, "Loading...")

w.App.SetBeforeDrawFunc(func(screen tcell.Screen) bool {
screen.Clear()
return false
w.App.SetAfterDrawFunc(func(screen tcell.Screen) {
_, _, width, _ := w.LastRoundTable.GetInnerRect()
columns := width / 50
w.LastRoundTableData.SetColumnsCount(columns)

w.App.SetAfterDrawFunc(nil)
})

if err := w.App.Run(); err != nil {
Expand Down

0 comments on commit 058cf87

Please sign in to comment.