From cc0bb6b743275523df56348ff67fc1d6dc7db906 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 7 Jan 2010 15:59:44 +0100 Subject: [PATCH] IC --- apps/menu.c | 35 ++++++++++++++++++++++++----------- apps/menu.h | 2 +- apps/plugin.h | 2 +- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/apps/menu.c b/apps/menu.c index 88f0f3c52..175267206 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -335,17 +335,25 @@ void do_setting_from_menu(const struct menu_item_ex *temp, /* display a menu */ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, - struct viewport parent[NB_SCREENS], bool hide_bars) + struct viewport parent[NB_SCREENS], bool hide_theme) { int selected = start_selected? *start_selected : 0; int action; + bool backdrop_reset = false; struct gui_synclist lists; const struct menu_item_ex *temp, *menu; int ret = 0, i; bool redraw_lists; + fb_data *bd = hide_theme ? NULL:lcd_get_backdrop(); + + FOR_NB_SCREENS(i) - viewportmanager_theme_enable(i, !hide_bars, NULL); - + { + if (!hide_theme) + screens[i].backdrop_show(BACKDROP_MAIN); + viewportmanager_theme_enable(i, !hide_theme, NULL); + } + const struct menu_item_ex *menu_stack[MAX_MENUS]; int menu_stack_selected_item[MAX_MENUS]; int stack_top = 0; @@ -363,7 +371,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, menu = &main_menu_; else menu = start_menu; - /* if hide_bars is true, assume parent has been fixed before passed into + /* if hide_theme is true, assume parent has been fixed before passed into * this function, e.g. with viewport_set_defaults(parent, screen) */ init_menu_lists(menu, &lists, selected, true, parent); vps = *(lists.parent); @@ -373,7 +381,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, #ifdef HAVE_BUTTONBAR - if (!hide_bars) + if (!hide_theme) { gui_buttonbar_set(&buttonbar, "<<<", "", ""); gui_buttonbar_draw(&buttonbar); @@ -382,7 +390,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, while (!done) { redraw_lists = false; - if (!hide_bars) + if (!hide_theme) { #ifdef HAVE_BUTTONBAR gui_buttonbar_draw(&buttonbar); @@ -551,7 +559,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, screens[i].scroll_stop(&vps[i]); } #ifdef HAVE_BUTTONBAR - if (!hide_bars) + if (!hide_theme) { gui_buttonbar_unset(&buttonbar); gui_buttonbar_draw(&buttonbar); @@ -653,7 +661,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, break; } #ifdef HAVE_BUTTONBAR - if (!hide_bars) + if (!hide_theme) { gui_buttonbar_set(&buttonbar, "<<<", "", ""); gui_buttonbar_draw(&buttonbar); @@ -686,8 +694,13 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, *start_selected = get_menu_selection( gui_synclist_get_sel_pos(&lists), menu); } - FOR_NB_SCREENS(i) - viewportmanager_theme_undo(i, false); + + + if (!hide_theme) /* currently no main backdrop on remotes, reset for caller*/ + lcd_set_backdrop(bd); + + FOR_NB_SCREENS(i) + viewportmanager_theme_undo(i, false); + return ret; } - diff --git a/apps/menu.h b/apps/menu.h index b386b7ce4..b5bab9098 100644 --- a/apps/menu.h +++ b/apps/menu.h @@ -121,7 +121,7 @@ void do_setting_from_menu(const struct menu_item_ex *temp, If NULL it is ignored and the firs item starts selected */ int do_menu(const struct menu_item_ex *menu, int *start_selected, - struct viewport parent[NB_SCREENS], bool hide_bars); + struct viewport parent[NB_SCREENS], bool hide_theme); /* In all the following macros the argument names are as follows: - name: The name for the variable (so it can be used in a MAKE_MENU() diff --git a/apps/plugin.h b/apps/plugin.h index cf16eef94..a7a6203e5 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -659,7 +659,7 @@ struct plugin_api { /* menu */ int (*do_menu)(const struct menu_item_ex *menu, int *start_selected, - struct viewport parent[NB_SCREENS], bool hide_bars); + struct viewport parent[NB_SCREENS], bool hide_theme); /* scroll bar */ struct gui_syncstatusbar *statusbars; -- 2.11.4.GIT