diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-01 09:37:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-01 09:37:37 +0200 |
commit | 87ed8c04563fc9f17d79223dd324754d972ca25e (patch) | |
tree | 052089315aba8977f0eb1edaf11c5d926d20a89b /common | |
parent | 44ebe21a33211961a573a7566801f81423928449 (diff) | |
parent | 22350e4e6805fa41284dbaae2cf662cd8ec69765 (diff) | |
download | barebox-87ed8c04563fc9f17d79223dd324754d972ca25e.tar.gz barebox-87ed8c04563fc9f17d79223dd324754d972ca25e.tar.xz |
Merge branch 'for-next/menu'
Diffstat (limited to 'common')
-rw-r--r-- | common/menu.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/common/menu.c b/common/menu.c index a672e59c0b..ef56190604 100644 --- a/common/menu.c +++ b/common/menu.c @@ -164,7 +164,7 @@ static void __print_entry(const char *str) static void print_menu_entry(struct menu *m, struct menu_entry *me, int selected) { - gotoXY(me->num + 1, 3); + gotoXY(3, me->num + 1); if (me->type == MENU_ENTRY_BOX) { if (me->box_state) @@ -175,7 +175,7 @@ static void print_menu_entry(struct menu *m, struct menu_entry *me, puts(" "); } - printf(" %d: ", me->num); + printf(" %2d: ", me->num); if (selected) puts("\e[7m"); @@ -234,7 +234,7 @@ static void print_menu(struct menu *m) struct menu_entry *me; clear(); - gotoXY(1, 2); + gotoXY(2, 1); if(m->display) { __print_entry(m->display); } else { @@ -269,7 +269,7 @@ int menu_show(struct menu *m) countdown = m->auto_select; if (m->auto_select >= 0) { - gotoXY(m->nb_entries + 2, 3); + gotoXY(3, m->nb_entries + 2); if (!m->auto_display) { printf("Auto Select in"); } else { @@ -293,10 +293,10 @@ int menu_show(struct menu *m) } } - gotoXY(m->nb_entries + 2, 3); + gotoXY(3, m->nb_entries + 2); printf("%*c", auto_display_len + 4, ' '); - gotoXY(m->selected->num + 1, 3); + gotoXY(3, m->selected->num + 1); do { struct menu_entry *old_selected = m->selected; @@ -361,7 +361,8 @@ int menu_show(struct menu *m) break; clear(); gotoXY(1,1); - m->selected->action(m, m->selected); + if (m->selected->action) + m->selected->action(m, m->selected); if (m->selected->non_re_ent) return m->selected->num; else |