|
24 | 24 | #define DICE_BAR_Y 90 |
25 | 25 | #define DICE_BAR_HEIGHT 14 |
26 | 26 |
|
27 | | -/* Left margin for seedtool_render_screen4's four body lines: a numbered list |
28 | | - * reads as a table, so every row starts at the same x rather than each being |
29 | | - * centred as its own block and drifting with how wide its own text is. */ |
| 27 | +/* Left margin for the four-row body: a numbered list reads as a table, so every |
| 28 | + * row starts at the same x rather than each being centred as its own block and |
| 29 | + * drifting with how wide its own text is. */ |
30 | 30 | #define SCREEN4_TEXT_X 20 |
31 | 31 |
|
32 | 32 | #define KEYBOARD_COLUMNS 10 |
|
80 | 80 | * at 103) and the bar. The small face fits the 14px left over; the 16px one |
81 | 81 | * would not. */ |
82 | 82 | #define NAV_COUNTER_Y 105 |
83 | | -/* seedtool_render_screen4's four left-aligned rows, kept at its own heights so |
84 | | - * a numbered list reads the same with the chrome as without it. */ |
| 83 | +/* Four left-aligned rows. The heights are inherited from the plain four-line |
| 84 | + * screen this replaced, and kept rather than re-derived: 28 to 88 in steps of |
| 85 | + * 20 fits four 16px lines between the header and the counter with a real gap |
| 86 | + * under each, which is the arithmetic the pixel scan in the self-test holds |
| 87 | + * them to. */ |
85 | 88 | #define NAV_ROWS_SHOWN 4 |
86 | 89 | #define NAV_ROWS_TOP 28 |
87 | 90 | #define NAV_ROWS_HEIGHT 20 |
@@ -425,42 +428,6 @@ void seedtool_render_screen(const char* title, const char* line1, const char* li |
425 | 428 | draw_centered(tft_DefaultFont, footer, 111); |
426 | 429 | } |
427 | 430 |
|
428 | | -/* Same face and footer as seedtool_render_screen, but a third body line |
429 | | - * pitched tighter (25px apart rather than 26, and starting closer to the |
430 | | - * title) so it still clears the footer: a long value paged three lines at a |
431 | | - * time needs a third of fewer pages to review, at the same 16px face. */ |
432 | | -void seedtool_render_screen3( |
433 | | - const char* title, const char* line1, const char* line2, const char* line3, const char* footer) |
434 | | -{ |
435 | | - seedtool_render_clear(); |
436 | | - draw_centered(tft_Ubuntu16, title, 5); |
437 | | - draw_centered(tft_Ubuntu16, line1, 33); |
438 | | - draw_centered(tft_Ubuntu16, line2, 58); |
439 | | - draw_centered(tft_Ubuntu16, line3, 83); |
440 | | - draw_centered(tft_DefaultFont, footer, 111); |
441 | | -} |
442 | | - |
443 | | -/* Same face and footer again, pitched tighter still (20px, against three |
444 | | - * lines' 25px) to fit a fourth: a numbered word (or word-number) list reads |
445 | | - * one entry per line, so 12 or 24 entries comes out to a clean 3 or 6 pages |
446 | | - * this way instead of the 4 or 8 three lines would need. Still clears the |
447 | | - * footer with room to spare at the same 16px face - the four lines run |
448 | | - * title+23 to title+23+3*20+16, i.e. y=28 to 108, three pixels shy of the |
449 | | - * footer at 111. Pixel-scanned directly (seedtool_render_pixels) to confirm |
450 | | - * every line clears the next with a real gap - the zoomed Compact SeedQR |
451 | | - * region label overlap bug was proof enough not to eyeball this arithmetic. */ |
452 | | -void seedtool_render_screen4(const char* title, const char* line1, const char* line2, const char* line3, |
453 | | - const char* line4, const char* footer) |
454 | | -{ |
455 | | - seedtool_render_clear(); |
456 | | - draw_centered(tft_Ubuntu16, title, 5); |
457 | | - draw_left(tft_Ubuntu16, line1, SCREEN4_TEXT_X, 28); |
458 | | - draw_left(tft_Ubuntu16, line2, SCREEN4_TEXT_X, 48); |
459 | | - draw_left(tft_Ubuntu16, line3, SCREEN4_TEXT_X, 68); |
460 | | - draw_left(tft_Ubuntu16, line4, SCREEN4_TEXT_X, 88); |
461 | | - draw_centered(tft_DefaultFont, footer, 111); |
462 | | -} |
463 | | - |
464 | 431 | seedtool_thumb_t seedtool_list_thumb(const size_t count, const size_t top, const int track) |
465 | 432 | { |
466 | 433 | seedtool_thumb_t thumb = { 0, track }; |
@@ -504,44 +471,6 @@ size_t seedtool_list_top(const size_t count, const size_t selected, size_t previ |
504 | 471 | return previous_top; |
505 | 472 | } |
506 | 473 |
|
507 | | -void seedtool_render_list(const char* title, const char* const* items, const size_t count, const size_t selected, |
508 | | - const size_t top, const char* footer) |
509 | | -{ |
510 | | - seedtool_render_clear(); |
511 | | - draw_centered(tft_Ubuntu16, title, LIST_TITLE_Y); |
512 | | - for (size_t row = 0; row < SEEDTOOL_LIST_ROWS && top + row < count; ++row) { |
513 | | - const char* const item = items[top + row]; |
514 | | - const bool highlighted = top + row == selected; |
515 | | - const int y = LIST_TOP + (int)row * LIST_ROW_HEIGHT; |
516 | | - /* A rule between rows, matching the nav lists and Jade's own menus: |
517 | | - * the rows read as cells rather than as stacked lines of text, and it |
518 | | - * sits in the gap between them so the selection bar never paints over |
519 | | - * it. Between them and not above the first, so this list and a nav one |
520 | | - * carry the same line in the same places - a screen that gained the |
521 | | - * chrome should not also change how its rows are drawn. |
522 | | - * |
523 | | - * It used to be drawn above the last row alone, to set the way out |
524 | | - * apart from the choices. That distinction now rests on position, |
525 | | - * which the last row has always had and which every list here keeps. */ |
526 | | - if (row) { |
527 | | - fill_rect(LIST_BAR_X, y - 1, LIST_BAR_WIDTH, 1, COLOR_DIM); |
528 | | - } |
529 | | - if (highlighted) { |
530 | | - fill_rect(LIST_BAR_X, y, LIST_BAR_WIDTH, LIST_ROW_HEIGHT - 2, COLOR_HIGHLIGHT); |
531 | | - } |
532 | | - draw_line_at(tft_Ubuntu16, item, seedtool_render_fit_row(item), LIST_TEXT_X, |
533 | | - y + (LIST_ROW_HEIGHT - tft_Ubuntu16[1]) / 2, highlighted ? COLOR_BLACK : COLOR_WHITE); |
534 | | - } |
535 | | - if (count > SEEDTOOL_LIST_ROWS) { |
536 | | - /* With three rows visible, "there is more" is not enough on its own: the |
537 | | - * thumb's size says how much more and its place says where in it. */ |
538 | | - const seedtool_thumb_t thumb = seedtool_list_thumb(count, top, LIST_SCROLL_HEIGHT); |
539 | | - fill_rect(LIST_SCROLL_X, LIST_TOP, LIST_SCROLL_WIDTH, LIST_SCROLL_HEIGHT, COLOR_DIM); |
540 | | - fill_rect(LIST_SCROLL_X, LIST_TOP + thumb.offset, LIST_SCROLL_WIDTH, thumb.height, COLOR_WHITE); |
541 | | - } |
542 | | - draw_centered(tft_DefaultFont, footer, LIST_FOOTER_Y); |
543 | | -} |
544 | | - |
545 | 474 | /* A solid left-pointing triangle with its apex at (x, y + height / 2): the |
546 | 475 | * back arrow, drawn rather than set, since the 16px face carries no glyph for |
547 | 476 | * one and Jade's own symbols font is not linked here. */ |
@@ -702,10 +631,11 @@ void seedtool_render_nav_text( |
702 | 631 | const seedtool_nav_t* nav, const char* title, const char* line1, const char* line2, const char* line3) |
703 | 632 | { |
704 | 633 | nav_begin(nav, title); |
705 | | - /* The same heights the plain screens use, so a screen gaining the chrome |
706 | | - * does not also move its own text - and the same choice between them that |
707 | | - * seedtool_render_screen and seedtool_render_screen3 make by being two |
708 | | - * functions: a third line means the three-line layout. */ |
| 634 | + /* Two layouts in one function, chosen by whether there is a third line: |
| 635 | + * two lines sit at 39 and 65, three at 33, 58 and 83, pitched tighter to |
| 636 | + * clear the counter. These were two separate screens before the chrome, |
| 637 | + * and the heights are theirs unchanged - a screen gaining the chrome |
| 638 | + * should not also move its own text. */ |
709 | 639 | if (line3) { |
710 | 640 | draw_centered(tft_Ubuntu16, line1, 33); |
711 | 641 | draw_centered(tft_Ubuntu16, line2, 58); |
|
0 commit comments