aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmenu
diff options
context:
space:
mode:
authorGravatar albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-03-27 19:27:42 +0000
committerGravatar albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-03-27 19:27:42 +0000
commit3db345c707ab6c5cfa76adff2351d0088f0bea4d (patch)
treecdac0a3296ae3058647fb4b0501cc75cb40b9ac3 /libmenu
parent03d71f6817458ea28f4530132e4e7ad753707d80 (diff)
Fix cycling in menu with hidden items.
Thanks again to Jonas Jermann for the report. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17981 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmenu')
-rw-r--r--libmenu/menu_list.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libmenu/menu_list.c b/libmenu/menu_list.c
index 3e1f4f621c..975b30f958 100644
--- a/libmenu/menu_list.c
+++ b/libmenu/menu_list.c
@@ -135,21 +135,25 @@ void menu_list_draw(menu_t* menu,mp_image_t* mpi) {
void menu_list_read_cmd(menu_t* menu,int cmd) {
switch(cmd) {
case MENU_CMD_UP:
- if(!mpriv->current->prev) {
- for( ; mpriv->current->next != NULL ; mpriv->current = mpriv->current->next)
- /* NOTHING */;
+ while(mpriv->current->prev) {
+ mpriv->current = mpriv->current->prev;
if(!mpriv->current->hide) return;
}
+ for( ; mpriv->current->next != NULL ; mpriv->current = mpriv->current->next)
+ /* NOTHING */;
+ if(!mpriv->current->hide) return;
while(mpriv->current->prev) {
mpriv->current = mpriv->current->prev;
if(!mpriv->current->hide) return;
}
break;
case MENU_CMD_DOWN:
- if(!mpriv->current->next) {
- mpriv->current = mpriv->menu;
+ while(mpriv->current->next) {
+ mpriv->current = mpriv->current->next;
if(!mpriv->current->hide) return;
}
+ mpriv->current = mpriv->menu;
+ if(!mpriv->current->hide) return;
while(mpriv->current->next) {
mpriv->current = mpriv->current->next;
if(!mpriv->current->hide) return;