| 252 | |
| 253 | |
| 254 | def paint_last_events(rows, columns, names, config): |
| 255 | if not names: |
| 256 | return fsarray([]) |
| 257 | width = min(max(len(name) for name in names), columns - 2) |
| 258 | output_lines = [] |
| 259 | output_lines.append( |
| 260 | config.left_top_corner |
| 261 | + config.top_border * width |
| 262 | + config.right_top_corner |
| 263 | ) |
| 264 | for name in reversed(names[max(0, len(names) - (rows - 2)) :]): |
| 265 | output_lines.append( |
| 266 | config.left_border |
| 267 | + name[:width].center(width) |
| 268 | + config.right_border |
| 269 | ) |
| 270 | output_lines.append( |
| 271 | config.left_bottom_corner |
| 272 | + config.bottom_border * width |
| 273 | + config.right_bottom_corner |
| 274 | ) |
| 275 | return fsarray(output_lines) |
| 276 | |
| 277 | |
| 278 | def paint_statusbar(rows, columns, msg, config): |