MCPcopy Index your code
hub / github.com/codechenx/FastTableViewer / drawStats

Function drawStats

ui.go:150–177  ·  view source on GitHub ↗

add stats data to stats table

(s statsSummary, t *tview.Table)

Source from the content-addressed store, hash-verified

148
149// add stats data to stats table
150func drawStats(s statsSummary, t *tview.Table) {
151 t.Clear()
152 summaryData := s.getSummaryData()
153 rows, cols := len(summaryData), len(summaryData[0])
154
155 for r := 0; r < rows; r++ {
156 for c := 0; c < cols; c++ {
157 color := tcell.ColorWhite
158 backgroundColor := tcell.ColorDefault
159
160 // Modern styling: alternate row colors for better readability
161 if r%2 == 1 {
162 backgroundColor = tcell.NewRGBColor(20, 20, 30)
163 }
164
165 // Highlight stat labels with accent color
166 if c == 0 {
167 color = tcell.NewRGBColor(100, 200, 255) // Soft blue for labels
168 }
169
170 t.SetCell(r, c,
171 tview.NewTableCell(summaryData[r][c]).
172 SetTextColor(color).
173 SetBackgroundColor(backgroundColor).
174 SetAlign(tview.AlignLeft))
175 }
176 }
177}
178
179// draw app UI
180func drawUI(b *Buffer) error {

Callers 1

showStatsDialogFunction · 0.85

Calls 1

getSummaryDataMethod · 0.65

Tested by

no test coverage detected