summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-07-11 02:22:03 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-07-11 02:22:03 +0000
commit411f3e2b2bb8ad93e9402bd90aba1894ecf25076 (patch)
treeab7426f6180753cb3afbb00fe73ac60de4f6d4a1
parentb9f22af85a04cc89913090a9d145ead055f38b43 (diff)
downloadrockbox-411f3e2b2bb8ad93e9402bd90aba1894ecf25076.tar.gz
rockbox-411f3e2b2bb8ad93e9402bd90aba1894ecf25076.zip
If the action handler for the menu returns ACTION_REDRAW the list will be redrawn. Fixes the Now Playing/Resume Playback text not updating
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13848 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/menu.c10
-rw-r--r--apps/root_menu.c4
2 files changed, 13 insertions, 1 deletions
diff --git a/apps/menu.c b/apps/menu.c
index 5386353e12..9a35af8e34 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -382,6 +382,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
382 struct gui_synclist lists; 382 struct gui_synclist lists;
383 const struct menu_item_ex *temp, *menu; 383 const struct menu_item_ex *temp, *menu;
384 int ret = 0; 384 int ret = 0;
385 bool redraw_lists;
385#ifdef HAS_BUTTONBAR 386#ifdef HAS_BUTTONBAR
386 struct gui_buttonbar buttonbar; 387 struct gui_buttonbar buttonbar;
387#endif 388#endif
@@ -415,6 +416,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
415 while (!done) 416 while (!done)
416 { 417 {
417 talk_item = false; 418 talk_item = false;
419 redraw_lists = false;
418 gui_syncstatusbar_draw(&statusbars, true); 420 gui_syncstatusbar_draw(&statusbars, true);
419 action = get_action(CONTEXT_MAINMENU,HZ); 421 action = get_action(CONTEXT_MAINMENU,HZ);
420 /* HZ so the status bar redraws corectly */ 422 /* HZ so the status bar redraws corectly */
@@ -433,6 +435,11 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
433 ret = MENU_SELECTED_EXIT; /* will exit after returning 435 ret = MENU_SELECTED_EXIT; /* will exit after returning
434 from selection */ 436 from selection */
435 } 437 }
438 else if (action == ACTION_REDRAW)
439 {
440 action = old_action;
441 redraw_lists = true;
442 }
436 } 443 }
437 444
438 if (gui_synclist_do_button(&lists,action,LIST_WRAP_UNLESS_HELD)) 445 if (gui_synclist_do_button(&lists,action,LIST_WRAP_UNLESS_HELD))
@@ -603,6 +610,9 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
603 } 610 }
604 if (talk_item && !done) 611 if (talk_item && !done)
605 talk_menu_item(menu, &lists); 612 talk_menu_item(menu, &lists);
613
614 if (redraw_lists)
615 gui_synclist_draw(&lists);
606 } 616 }
607 action_signalscreenchange(); 617 action_signalscreenchange();
608 if (start_selected) 618 if (start_selected)
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 1451a60a16..e99cb4aa88 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -342,7 +342,7 @@ MENUITEM_FUNCTION(do_shutdown_item, 0, ID2P(LANG_SHUTDOWN),
342 do_shutdown, NULL, NULL, Icon_NOICON); 342 do_shutdown, NULL, NULL, Icon_NOICON);
343#endif 343#endif
344MAKE_MENU(root_menu_, ID2P(LANG_ROCKBOX_TITLE), 344MAKE_MENU(root_menu_, ID2P(LANG_ROCKBOX_TITLE),
345 NULL, Icon_Rockbox, 345 item_callback, Icon_Rockbox,
346 &bookmarks, &file_browser, 346 &bookmarks, &file_browser,
347#ifdef HAVE_TAGCACHE 347#ifdef HAVE_TAGCACHE
348 &db_browser, 348 &db_browser,
@@ -365,6 +365,8 @@ int item_callback(int action, const struct menu_item_ex *this_item)
365{ 365{
366 switch (action) 366 switch (action)
367 { 367 {
368 case ACTION_TREE_STOP:
369 return ACTION_REDRAW;
368 case ACTION_REQUEST_MENUITEM: 370 case ACTION_REQUEST_MENUITEM:
369#if CONFIG_TUNER 371#if CONFIG_TUNER
370 if (this_item == &fm) 372 if (this_item == &fm)