summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Marshall <tdm@cyngn.com>2014-07-25 15:07:15 -0700
committerTom Marshall <tdm@cyngn.com>2015-11-25 15:35:47 -0800
commitdd42d5600bc3772b92d7d0306fd021037e37094a (patch)
tree99f595b892349bc8d04f0160bcf4d2c501ada100
parent21d3a8f8230ae4f1f9210d6ec40f92ae023ec43a (diff)
downloadbootable_recovery-dd42d5600bc3772b92d7d0306fd021037e37094a.zip
bootable_recovery-dd42d5600bc3772b92d7d0306fd021037e37094a.tar.gz
bootable_recovery-dd42d5600bc3772b92d7d0306fd021037e37094a.tar.bz2
sr: Fix menu wrapping
Reset menu_show_start_ if the selected item won't be visible. This fixes the display after selecting an item from the second page in the file list. Change-Id: Iff2bef39ec294c47bcaadce4128adb6d14d9e4db
-rw-r--r--screen_ui.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 5ed74a6..aef714b 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -815,6 +815,10 @@ void ScreenRecoveryUI::StartMenu(const char* const * headers, const char* const
menu_items = i;
show_menu = true;
menu_sel = initial_selection;
+ if (menu_show_start_ <= menu_sel - max_menu_rows_ ||
+ menu_show_start_ > menu_sel) {
+ menu_show_start_ = menu_sel;
+ }
update_screen_locked();
}
pthread_mutex_unlock(&updateMutex);