(c int, title string, hh model.MenuHints)
| 320 | } |
| 321 | |
| 322 | func (h *Help) addSection(c int, title string, hh model.MenuHints) { |
| 323 | if len(hh) > h.maxRows { |
| 324 | h.maxRows = len(hh) |
| 325 | } |
| 326 | row := 0 |
| 327 | h.SetCell(row, c, h.titleCell(title)) |
| 328 | h.addSpacer(c + 1) |
| 329 | row++ |
| 330 | |
| 331 | for _, hint := range hh { |
| 332 | col := c |
| 333 | h.SetCell(row, col, padCellWithRef(ui.ToMnemonic(hint.Mnemonic), h.maxKey, hint.Mnemonic)) |
| 334 | col++ |
| 335 | h.SetCell(row, col, padCell(hint.Description, h.maxDesc)) |
| 336 | row++ |
| 337 | } |
| 338 | |
| 339 | if len(hh) >= h.maxRows { |
| 340 | return |
| 341 | } |
| 342 | |
| 343 | for i := h.maxRows - len(hh); i > 0; i-- { |
| 344 | col := c |
| 345 | h.SetCell(row, col, padCell("", h.maxKey)) |
| 346 | col++ |
| 347 | h.SetCell(row, col, padCell("", h.maxDesc)) |
| 348 | row++ |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | func (h *Help) updateStyle() { |
| 353 | var ( |
no test coverage detected