aboutsummaryrefslogtreecommitdiffstats
path: root/ui.c
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2012-01-31 20:02:38 -0800
committerKoushik Dutta <koushd@gmail.com>2012-01-31 20:28:36 -0800
commit1c50ff29e69c4df6c6459e12942d62237e028b34 (patch)
treecdc3967be2f6b3d95ce70204082bca10839141e5 /ui.c
parenta465962667a4567e57e35f5193eb4fbd2b98e938 (diff)
downloadbootable_recovery-1c50ff29e69c4df6c6459e12942d62237e028b34.zip
bootable_recovery-1c50ff29e69c4df6c6459e12942d62237e028b34.tar.gz
bootable_recovery-1c50ff29e69c4df6c6459e12942d62237e028b34.tar.bz2
Fix ui menu bug for long menus.
Change-Id: If009dee6b7597daeec62dd65baa7ad35e1adec5d Conflicts: ui.c
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui.c b/ui.c
index a3cce50..a56d8c0 100644
--- a/ui.c
+++ b/ui.c
@@ -238,8 +238,8 @@ static void draw_screen_locked(void)
row++;
}
- if (menu_items - menu_show_start + menu_top >= MAX_ROWS)
- j = MAX_ROWS - menu_top;
+ if (menu_items - menu_show_start + menu_top >= max_menu_rows)
+ j = max_menu_rows - menu_top;
else
j = menu_items - menu_show_start;
@@ -254,13 +254,13 @@ static void draw_screen_locked(void)
draw_text_line(i - menu_show_start, menu[i]);
}
row++;
- if (row == max_menu_rows)
+ if (row >= max_menu_rows)
break;
}
- if (menu_items <= MAX_ROWS)
+ if (menu_items <= max_menu_rows)
offset = 1;
-
+
gr_fill(0, (row-offset)*CHAR_HEIGHT+CHAR_HEIGHT/2-1,
gr_fb_width(), (row-offset)*CHAR_HEIGHT+CHAR_HEIGHT/2+1);
}
@@ -444,6 +444,8 @@ void ui_init(void)
text_col = text_row = 0;
text_rows = gr_fb_height() / CHAR_HEIGHT;
max_menu_rows = text_rows - MIN_LOG_ROWS;
+ if (max_menu_rows > MENU_MAX_ROWS)
+ max_menu_rows = MENU_MAX_ROWS;
if (text_rows > MAX_ROWS) text_rows = MAX_ROWS;
text_top = 1;