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 (#40)
  • Loading branch information
freak12techno authored Oct 11, 2024
1 parent e763d05 commit 01c9e7e
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 01c9e7e

Please sign in to comment.