From 9551cf912180665a85f515c16d6412bb8ea2bf98 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Fri, 4 Apr 2014 13:48:33 -0700 Subject: make density-specific recovery assets Provide different recovery UI resources for different display densities. Right now only the text images and the progress bars are rescaled; the main icon will get scaled when it's updated for QP. Lightly quantum-ify the rest of the recovery interface. (Light background, progress bars, etc.) Change-Id: Ia639c4ce8534b01bc843524efbc4b040c1cf38b3 --- res-hdpi/images/erasing_text.png | Bin 0 -> 20528 bytes res-hdpi/images/error_text.png | Bin 0 -> 11684 bytes res-hdpi/images/icon_error.png | Bin 0 -> 19306 bytes res-hdpi/images/icon_installing.png | Bin 0 -> 118562 bytes res-hdpi/images/installing_text.png | Bin 0 -> 40946 bytes res-hdpi/images/no_command_text.png | Bin 0 -> 25013 bytes res-hdpi/images/progress_empty.png | Bin 0 -> 81 bytes res-hdpi/images/progress_fill.png | Bin 0 -> 83 bytes res-hdpi/images/stage_empty.png | Bin 0 -> 322 bytes res-hdpi/images/stage_fill.png | Bin 0 -> 258 bytes res-mdpi/images/erasing_text.png | Bin 0 -> 12208 bytes res-mdpi/images/error_text.png | Bin 0 -> 7202 bytes res-mdpi/images/icon_error.png | Bin 0 -> 19306 bytes res-mdpi/images/icon_installing.png | Bin 0 -> 118562 bytes res-mdpi/images/installing_text.png | Bin 0 -> 24575 bytes res-mdpi/images/no_command_text.png | Bin 0 -> 14168 bytes res-mdpi/images/progress_empty.png | Bin 0 -> 74 bytes res-mdpi/images/progress_fill.png | Bin 0 -> 83 bytes res-mdpi/images/stage_empty.png | Bin 0 -> 322 bytes res-mdpi/images/stage_fill.png | Bin 0 -> 258 bytes res-xhdpi/images/erasing_text.png | Bin 0 -> 29674 bytes res-xhdpi/images/error_text.png | Bin 0 -> 16599 bytes res-xhdpi/images/icon_error.png | Bin 0 -> 19306 bytes res-xhdpi/images/icon_installing.png | Bin 0 -> 118562 bytes res-xhdpi/images/installing_text.png | Bin 0 -> 63220 bytes res-xhdpi/images/no_command_text.png | Bin 0 -> 37222 bytes res-xhdpi/images/progress_empty.png | Bin 0 -> 84 bytes res-xhdpi/images/progress_fill.png | Bin 0 -> 84 bytes res-xhdpi/images/stage_empty.png | Bin 0 -> 322 bytes res-xhdpi/images/stage_fill.png | Bin 0 -> 258 bytes res-xxhdpi/images/erasing_text.png | Bin 0 -> 52598 bytes res-xxhdpi/images/error_text.png | Bin 0 -> 27839 bytes res-xxhdpi/images/icon_error.png | Bin 0 -> 19306 bytes res-xxhdpi/images/icon_installing.png | Bin 0 -> 118562 bytes res-xxhdpi/images/installing_text.png | Bin 0 -> 133331 bytes res-xxhdpi/images/no_command_text.png | Bin 0 -> 63887 bytes res-xxhdpi/images/progress_empty.png | Bin 0 -> 86 bytes res-xxhdpi/images/progress_fill.png | Bin 0 -> 86 bytes res-xxhdpi/images/stage_empty.png | Bin 0 -> 322 bytes res-xxhdpi/images/stage_fill.png | Bin 0 -> 258 bytes res-xxxhdpi/images/erasing_text.png | Bin 0 -> 85500 bytes res-xxxhdpi/images/error_text.png | Bin 0 -> 40216 bytes res-xxxhdpi/images/icon_error.png | Bin 0 -> 19306 bytes res-xxxhdpi/images/icon_installing.png | Bin 0 -> 118562 bytes res-xxxhdpi/images/installing_text.png | Bin 0 -> 184958 bytes res-xxxhdpi/images/no_command_text.png | Bin 0 -> 109746 bytes res-xxxhdpi/images/progress_empty.png | Bin 0 -> 90 bytes res-xxxhdpi/images/progress_fill.png | Bin 0 -> 90 bytes res-xxxhdpi/images/stage_empty.png | Bin 0 -> 322 bytes res-xxxhdpi/images/stage_fill.png | Bin 0 -> 258 bytes res/images/erasing_text.png | Bin 31491 -> 0 bytes res/images/error_text.png | Bin 17504 -> 0 bytes res/images/icon_error.png | Bin 19306 -> 0 bytes res/images/icon_installing.png | Bin 118562 -> 0 bytes res/images/installing_text.png | Bin 66592 -> 0 bytes res/images/no_command_text.png | Bin 40632 -> 0 bytes res/images/progress_empty.png | Bin 118 -> 0 bytes res/images/progress_fill.png | Bin 404 -> 0 bytes res/images/stage_empty.png | Bin 322 -> 0 bytes res/images/stage_fill.png | Bin 258 -> 0 bytes screen_ui.cpp | 29 +++++++++++++---------------- screen_ui.h | 3 +++ 62 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 res-hdpi/images/erasing_text.png create mode 100644 res-hdpi/images/error_text.png create mode 100644 res-hdpi/images/icon_error.png create mode 100644 res-hdpi/images/icon_installing.png create mode 100644 res-hdpi/images/installing_text.png create mode 100644 res-hdpi/images/no_command_text.png create mode 100644 res-hdpi/images/progress_empty.png create mode 100644 res-hdpi/images/progress_fill.png create mode 100644 res-hdpi/images/stage_empty.png create mode 100644 res-hdpi/images/stage_fill.png create mode 100644 res-mdpi/images/erasing_text.png create mode 100644 res-mdpi/images/error_text.png create mode 100644 res-mdpi/images/icon_error.png create mode 100644 res-mdpi/images/icon_installing.png create mode 100644 res-mdpi/images/installing_text.png create mode 100644 res-mdpi/images/no_command_text.png create mode 100644 res-mdpi/images/progress_empty.png create mode 100644 res-mdpi/images/progress_fill.png create mode 100644 res-mdpi/images/stage_empty.png create mode 100644 res-mdpi/images/stage_fill.png create mode 100644 res-xhdpi/images/erasing_text.png create mode 100644 res-xhdpi/images/error_text.png create mode 100644 res-xhdpi/images/icon_error.png create mode 100644 res-xhdpi/images/icon_installing.png create mode 100644 res-xhdpi/images/installing_text.png create mode 100644 res-xhdpi/images/no_command_text.png create mode 100644 res-xhdpi/images/progress_empty.png create mode 100644 res-xhdpi/images/progress_fill.png create mode 100644 res-xhdpi/images/stage_empty.png create mode 100644 res-xhdpi/images/stage_fill.png create mode 100644 res-xxhdpi/images/erasing_text.png create mode 100644 res-xxhdpi/images/error_text.png create mode 100644 res-xxhdpi/images/icon_error.png create mode 100644 res-xxhdpi/images/icon_installing.png create mode 100644 res-xxhdpi/images/installing_text.png create mode 100644 res-xxhdpi/images/no_command_text.png create mode 100644 res-xxhdpi/images/progress_empty.png create mode 100644 res-xxhdpi/images/progress_fill.png create mode 100644 res-xxhdpi/images/stage_empty.png create mode 100644 res-xxhdpi/images/stage_fill.png create mode 100644 res-xxxhdpi/images/erasing_text.png create mode 100644 res-xxxhdpi/images/error_text.png create mode 100644 res-xxxhdpi/images/icon_error.png create mode 100644 res-xxxhdpi/images/icon_installing.png create mode 100644 res-xxxhdpi/images/installing_text.png create mode 100644 res-xxxhdpi/images/no_command_text.png create mode 100644 res-xxxhdpi/images/progress_empty.png create mode 100644 res-xxxhdpi/images/progress_fill.png create mode 100644 res-xxxhdpi/images/stage_empty.png create mode 100644 res-xxxhdpi/images/stage_fill.png delete mode 100644 res/images/erasing_text.png delete mode 100644 res/images/error_text.png delete mode 100644 res/images/icon_error.png delete mode 100644 res/images/icon_installing.png delete mode 100644 res/images/installing_text.png delete mode 100644 res/images/no_command_text.png delete mode 100644 res/images/progress_empty.png delete mode 100644 res/images/progress_fill.png delete mode 100644 res/images/stage_empty.png delete mode 100644 res/images/stage_fill.png diff --git a/res-hdpi/images/erasing_text.png b/res-hdpi/images/erasing_text.png new file mode 100644 index 000000000..774244c84 Binary files /dev/null and b/res-hdpi/images/erasing_text.png differ diff --git a/res-hdpi/images/error_text.png b/res-hdpi/images/error_text.png new file mode 100644 index 000000000..64a57ec4e Binary files /dev/null and b/res-hdpi/images/error_text.png differ diff --git a/res-hdpi/images/icon_error.png b/res-hdpi/images/icon_error.png new file mode 100644 index 000000000..cb3d1ab22 Binary files /dev/null and b/res-hdpi/images/icon_error.png differ diff --git a/res-hdpi/images/icon_installing.png b/res-hdpi/images/icon_installing.png new file mode 100644 index 000000000..c2c020162 Binary files /dev/null and b/res-hdpi/images/icon_installing.png differ diff --git a/res-hdpi/images/installing_text.png b/res-hdpi/images/installing_text.png new file mode 100644 index 000000000..33b54f1bf Binary files /dev/null and b/res-hdpi/images/installing_text.png differ diff --git a/res-hdpi/images/no_command_text.png b/res-hdpi/images/no_command_text.png new file mode 100644 index 000000000..9927ecb6d Binary files /dev/null and b/res-hdpi/images/no_command_text.png differ diff --git a/res-hdpi/images/progress_empty.png b/res-hdpi/images/progress_empty.png new file mode 100644 index 000000000..b29d9be0c Binary files /dev/null and b/res-hdpi/images/progress_empty.png differ diff --git a/res-hdpi/images/progress_fill.png b/res-hdpi/images/progress_fill.png new file mode 100644 index 000000000..4c5e66bb5 Binary files /dev/null and b/res-hdpi/images/progress_fill.png differ diff --git a/res-hdpi/images/stage_empty.png b/res-hdpi/images/stage_empty.png new file mode 100644 index 000000000..251ec1969 Binary files /dev/null and b/res-hdpi/images/stage_empty.png differ diff --git a/res-hdpi/images/stage_fill.png b/res-hdpi/images/stage_fill.png new file mode 100644 index 000000000..1ab79e862 Binary files /dev/null and b/res-hdpi/images/stage_fill.png differ diff --git a/res-mdpi/images/erasing_text.png b/res-mdpi/images/erasing_text.png new file mode 100644 index 000000000..fd86c3f6e Binary files /dev/null and b/res-mdpi/images/erasing_text.png differ diff --git a/res-mdpi/images/error_text.png b/res-mdpi/images/error_text.png new file mode 100644 index 000000000..f1b44c9b3 Binary files /dev/null and b/res-mdpi/images/error_text.png differ diff --git a/res-mdpi/images/icon_error.png b/res-mdpi/images/icon_error.png new file mode 100644 index 000000000..cb3d1ab22 Binary files /dev/null and b/res-mdpi/images/icon_error.png differ diff --git a/res-mdpi/images/icon_installing.png b/res-mdpi/images/icon_installing.png new file mode 100644 index 000000000..c2c020162 Binary files /dev/null and b/res-mdpi/images/icon_installing.png differ diff --git a/res-mdpi/images/installing_text.png b/res-mdpi/images/installing_text.png new file mode 100644 index 000000000..064b2a317 Binary files /dev/null and b/res-mdpi/images/installing_text.png differ diff --git a/res-mdpi/images/no_command_text.png b/res-mdpi/images/no_command_text.png new file mode 100644 index 000000000..1f29b8951 Binary files /dev/null and b/res-mdpi/images/no_command_text.png differ diff --git a/res-mdpi/images/progress_empty.png b/res-mdpi/images/progress_empty.png new file mode 100644 index 000000000..0883e0070 Binary files /dev/null and b/res-mdpi/images/progress_empty.png differ diff --git a/res-mdpi/images/progress_fill.png b/res-mdpi/images/progress_fill.png new file mode 100644 index 000000000..c223871b9 Binary files /dev/null and b/res-mdpi/images/progress_fill.png differ diff --git a/res-mdpi/images/stage_empty.png b/res-mdpi/images/stage_empty.png new file mode 100644 index 000000000..251ec1969 Binary files /dev/null and b/res-mdpi/images/stage_empty.png differ diff --git a/res-mdpi/images/stage_fill.png b/res-mdpi/images/stage_fill.png new file mode 100644 index 000000000..1ab79e862 Binary files /dev/null and b/res-mdpi/images/stage_fill.png differ diff --git a/res-xhdpi/images/erasing_text.png b/res-xhdpi/images/erasing_text.png new file mode 100644 index 000000000..f88e0e6a8 Binary files /dev/null and b/res-xhdpi/images/erasing_text.png differ diff --git a/res-xhdpi/images/error_text.png b/res-xhdpi/images/error_text.png new file mode 100644 index 000000000..c3a4cc6f8 Binary files /dev/null and b/res-xhdpi/images/error_text.png differ diff --git a/res-xhdpi/images/icon_error.png b/res-xhdpi/images/icon_error.png new file mode 100644 index 000000000..cb3d1ab22 Binary files /dev/null and b/res-xhdpi/images/icon_error.png differ diff --git a/res-xhdpi/images/icon_installing.png b/res-xhdpi/images/icon_installing.png new file mode 100644 index 000000000..c2c020162 Binary files /dev/null and b/res-xhdpi/images/icon_installing.png differ diff --git a/res-xhdpi/images/installing_text.png b/res-xhdpi/images/installing_text.png new file mode 100644 index 000000000..a4dacd0f6 Binary files /dev/null and b/res-xhdpi/images/installing_text.png differ diff --git a/res-xhdpi/images/no_command_text.png b/res-xhdpi/images/no_command_text.png new file mode 100644 index 000000000..eb34e94b3 Binary files /dev/null and b/res-xhdpi/images/no_command_text.png differ diff --git a/res-xhdpi/images/progress_empty.png b/res-xhdpi/images/progress_empty.png new file mode 100644 index 000000000..429797bf0 Binary files /dev/null and b/res-xhdpi/images/progress_empty.png differ diff --git a/res-xhdpi/images/progress_fill.png b/res-xhdpi/images/progress_fill.png new file mode 100644 index 000000000..7af35aaf1 Binary files /dev/null and b/res-xhdpi/images/progress_fill.png differ diff --git a/res-xhdpi/images/stage_empty.png b/res-xhdpi/images/stage_empty.png new file mode 100644 index 000000000..251ec1969 Binary files /dev/null and b/res-xhdpi/images/stage_empty.png differ diff --git a/res-xhdpi/images/stage_fill.png b/res-xhdpi/images/stage_fill.png new file mode 100644 index 000000000..1ab79e862 Binary files /dev/null and b/res-xhdpi/images/stage_fill.png differ diff --git a/res-xxhdpi/images/erasing_text.png b/res-xxhdpi/images/erasing_text.png new file mode 100644 index 000000000..c87fd52b4 Binary files /dev/null and b/res-xxhdpi/images/erasing_text.png differ diff --git a/res-xxhdpi/images/error_text.png b/res-xxhdpi/images/error_text.png new file mode 100644 index 000000000..486e951df Binary files /dev/null and b/res-xxhdpi/images/error_text.png differ diff --git a/res-xxhdpi/images/icon_error.png b/res-xxhdpi/images/icon_error.png new file mode 100644 index 000000000..cb3d1ab22 Binary files /dev/null and b/res-xxhdpi/images/icon_error.png differ diff --git a/res-xxhdpi/images/icon_installing.png b/res-xxhdpi/images/icon_installing.png new file mode 100644 index 000000000..c2c020162 Binary files /dev/null and b/res-xxhdpi/images/icon_installing.png differ diff --git a/res-xxhdpi/images/installing_text.png b/res-xxhdpi/images/installing_text.png new file mode 100644 index 000000000..ef6e8f3f0 Binary files /dev/null and b/res-xxhdpi/images/installing_text.png differ diff --git a/res-xxhdpi/images/no_command_text.png b/res-xxhdpi/images/no_command_text.png new file mode 100644 index 000000000..cc98bb18a Binary files /dev/null and b/res-xxhdpi/images/no_command_text.png differ diff --git a/res-xxhdpi/images/progress_empty.png b/res-xxhdpi/images/progress_empty.png new file mode 100644 index 000000000..57c823587 Binary files /dev/null and b/res-xxhdpi/images/progress_empty.png differ diff --git a/res-xxhdpi/images/progress_fill.png b/res-xxhdpi/images/progress_fill.png new file mode 100644 index 000000000..0f36f48c2 Binary files /dev/null and b/res-xxhdpi/images/progress_fill.png differ diff --git a/res-xxhdpi/images/stage_empty.png b/res-xxhdpi/images/stage_empty.png new file mode 100644 index 000000000..251ec1969 Binary files /dev/null and b/res-xxhdpi/images/stage_empty.png differ diff --git a/res-xxhdpi/images/stage_fill.png b/res-xxhdpi/images/stage_fill.png new file mode 100644 index 000000000..1ab79e862 Binary files /dev/null and b/res-xxhdpi/images/stage_fill.png differ diff --git a/res-xxxhdpi/images/erasing_text.png b/res-xxxhdpi/images/erasing_text.png new file mode 100644 index 000000000..612e7a390 Binary files /dev/null and b/res-xxxhdpi/images/erasing_text.png differ diff --git a/res-xxxhdpi/images/error_text.png b/res-xxxhdpi/images/error_text.png new file mode 100644 index 000000000..50d2fadb5 Binary files /dev/null and b/res-xxxhdpi/images/error_text.png differ diff --git a/res-xxxhdpi/images/icon_error.png b/res-xxxhdpi/images/icon_error.png new file mode 100644 index 000000000..cb3d1ab22 Binary files /dev/null and b/res-xxxhdpi/images/icon_error.png differ diff --git a/res-xxxhdpi/images/icon_installing.png b/res-xxxhdpi/images/icon_installing.png new file mode 100644 index 000000000..c2c020162 Binary files /dev/null and b/res-xxxhdpi/images/icon_installing.png differ diff --git a/res-xxxhdpi/images/installing_text.png b/res-xxxhdpi/images/installing_text.png new file mode 100644 index 000000000..9bd093bf4 Binary files /dev/null and b/res-xxxhdpi/images/installing_text.png differ diff --git a/res-xxxhdpi/images/no_command_text.png b/res-xxxhdpi/images/no_command_text.png new file mode 100644 index 000000000..6354e6a99 Binary files /dev/null and b/res-xxxhdpi/images/no_command_text.png differ diff --git a/res-xxxhdpi/images/progress_empty.png b/res-xxxhdpi/images/progress_empty.png new file mode 100644 index 000000000..ba25afb6e Binary files /dev/null and b/res-xxxhdpi/images/progress_empty.png differ diff --git a/res-xxxhdpi/images/progress_fill.png b/res-xxxhdpi/images/progress_fill.png new file mode 100644 index 000000000..83b72b27e Binary files /dev/null and b/res-xxxhdpi/images/progress_fill.png differ diff --git a/res-xxxhdpi/images/stage_empty.png b/res-xxxhdpi/images/stage_empty.png new file mode 100644 index 000000000..251ec1969 Binary files /dev/null and b/res-xxxhdpi/images/stage_empty.png differ diff --git a/res-xxxhdpi/images/stage_fill.png b/res-xxxhdpi/images/stage_fill.png new file mode 100644 index 000000000..1ab79e862 Binary files /dev/null and b/res-xxxhdpi/images/stage_fill.png differ diff --git a/res/images/erasing_text.png b/res/images/erasing_text.png deleted file mode 100644 index 441768a0c..000000000 Binary files a/res/images/erasing_text.png and /dev/null differ diff --git a/res/images/error_text.png b/res/images/error_text.png deleted file mode 100644 index 4ac6391ff..000000000 Binary files a/res/images/error_text.png and /dev/null differ diff --git a/res/images/icon_error.png b/res/images/icon_error.png deleted file mode 100644 index cb3d1ab22..000000000 Binary files a/res/images/icon_error.png and /dev/null differ diff --git a/res/images/icon_installing.png b/res/images/icon_installing.png deleted file mode 100644 index c2c020162..000000000 Binary files a/res/images/icon_installing.png and /dev/null differ diff --git a/res/images/installing_text.png b/res/images/installing_text.png deleted file mode 100644 index e1ac819e6..000000000 Binary files a/res/images/installing_text.png and /dev/null differ diff --git a/res/images/no_command_text.png b/res/images/no_command_text.png deleted file mode 100644 index a688f0935..000000000 Binary files a/res/images/no_command_text.png and /dev/null differ diff --git a/res/images/progress_empty.png b/res/images/progress_empty.png deleted file mode 100644 index 72581832c..000000000 Binary files a/res/images/progress_empty.png and /dev/null differ diff --git a/res/images/progress_fill.png b/res/images/progress_fill.png deleted file mode 100644 index becf87bdf..000000000 Binary files a/res/images/progress_fill.png and /dev/null differ diff --git a/res/images/stage_empty.png b/res/images/stage_empty.png deleted file mode 100644 index 251ec1969..000000000 Binary files a/res/images/stage_empty.png and /dev/null differ diff --git a/res/images/stage_fill.png b/res/images/stage_fill.png deleted file mode 100644 index 1ab79e862..000000000 Binary files a/res/images/stage_fill.png and /dev/null differ diff --git a/screen_ui.cpp b/screen_ui.cpp index af58643dc..afe856c37 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -87,7 +87,7 @@ ScreenRecoveryUI::ScreenRecoveryUI() : void ScreenRecoveryUI::draw_background_locked(Icon icon) { pagesIdentical = false; - gr_color(0, 0, 0, 255); + gr_color(250, 250, 250, 255); gr_clear(); if (icon) { @@ -123,7 +123,7 @@ void ScreenRecoveryUI::draw_background_locked(Icon icon) } } - gr_color(255, 255, 255, 255); + gr_color(115, 115, 115, 255); gr_texticon(textX, textY, text_surface); } } @@ -148,7 +148,7 @@ void ScreenRecoveryUI::draw_progress_locked() int dy = (3*gr_fb_height() + iconHeight - 2*height)/4; // Erase behind the progress bar (in case this was a progress-only update) - gr_color(0, 0, 0, 255); + gr_color(250, 250, 250, 255); gr_fill(dx, dy, width, height); if (progressBarType == DETERMINATE) { @@ -179,20 +179,17 @@ void ScreenRecoveryUI::draw_progress_locked() void ScreenRecoveryUI::SetColor(UIElement e) { switch (e) { case HEADER: - gr_color(247, 0, 6, 255); + gr_color(0xff, 0x57, 0x22, 255); // Quantum "Deep Orange" 500 break; case MENU: case MENU_SEL_BG: - gr_color(0, 106, 157, 255); + gr_color(0x67, 0x3a, 0xb7, 255); // Quantum "Deep Purple" 500 break; case MENU_SEL_FG: gr_color(255, 255, 255, 255); break; case LOG: - gr_color(249, 194, 0, 255); - break; - case TEXT_FILL: - gr_color(0, 0, 0, 160); + gr_color(0x3f, 0x51, 0xb5, 255); // Quantum "Indigo" 500 break; default: gr_color(255, 255, 255, 255); @@ -208,7 +205,7 @@ void ScreenRecoveryUI::draw_screen_locked() draw_background_locked(currentIcon); draw_progress_locked(); } else { - gr_color(0, 0, 0, 255); + gr_color(250, 250, 250, 255); gr_clear(); int y = 0; @@ -222,13 +219,13 @@ void ScreenRecoveryUI::draw_screen_locked() if (i == menu_top + menu_sel) { // draw the highlight bar SetColor(MENU_SEL_BG); - gr_fill(0, y-2, gr_fb_width(), y+char_height+2); + gr_fill(0, y-2+kTextYOffset, gr_fb_width(), y+char_height+2+kTextYOffset); // white text of selected item SetColor(MENU_SEL_FG); - if (menu[i][0]) gr_text(4, y, menu[i], 1); + if (menu[i][0]) gr_text(kTextXOffset, y+kTextYOffset, menu[i], 1); SetColor(MENU); } else { - if (menu[i][0]) gr_text(4, y, menu[i], i < menu_top); + if (menu[i][0]) gr_text(kTextXOffset, y+kTextYOffset, menu[i], i < menu_top); } y += char_height+4; } @@ -249,7 +246,7 @@ void ScreenRecoveryUI::draw_screen_locked() for (int ty = gr_fb_height() - char_height, count = 0; ty > y+2 && count < text_rows; ty -= char_height, ++count) { - gr_text(4, ty, text[row], 0); + gr_text(kTextXOffset, ty+kTextYOffset, text[row], 0); --row; if (row < 0) row = text_rows-1; } @@ -350,11 +347,11 @@ void ScreenRecoveryUI::Init() gr_font_size(&char_width, &char_height); text_col = text_row = 0; - text_rows = gr_fb_height() / char_height; + text_rows = (gr_fb_height() - 2 * kTextYOffset) / char_height; if (text_rows > kMaxRows) text_rows = kMaxRows; text_top = 1; - text_cols = gr_fb_width() / char_width; + text_cols = (gr_fb_width() - 2 * kTextXOffset) / char_width; if (text_cols > kMaxCols - 1) text_cols = kMaxCols - 1; backgroundIcon[NONE] = NULL; diff --git a/screen_ui.h b/screen_ui.h index 92e4795b4..2e01acdae 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -87,6 +87,9 @@ class ScreenRecoveryUI : public RecoveryUI { static const int kMaxCols = 96; static const int kMaxRows = 96; + static const int kTextXOffset = 8; + static const int kTextYOffset = 4; + // Log text overlay, displayed when a magic key is pressed char text[kMaxRows][kMaxCols]; int text_cols, text_rows; -- cgit v1.2.3