diff options
Diffstat (limited to 'apps/menus')
-rw-r--r-- | apps/menus/display_menu.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index 24e36e5fca..0b2769831e 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "screens.h" | 40 | #include "screens.h" |
41 | #endif | 41 | #endif |
42 | #include "viewport.h" | 42 | #include "viewport.h" |
43 | #include "statusbar.h" /* statusbar_vals enum*/ | ||
43 | 44 | ||
44 | #ifdef HAVE_BACKLIGHT | 45 | #ifdef HAVE_BACKLIGHT |
45 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) | 46 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) |
@@ -307,23 +308,50 @@ MAKE_MENU(scroll_settings_menu, ID2P(LANG_SCROLL_MENU), 0, Icon_NOICON, | |||
307 | /***********************************/ | 308 | /***********************************/ |
308 | /* BARS MENU */ | 309 | /* BARS MENU */ |
309 | #ifdef HAVE_LCD_BITMAP | 310 | #ifdef HAVE_LCD_BITMAP |
310 | static int statusbar_callback(int action,const struct menu_item_ex *this_item) | 311 | static int statusbar_callback_ex(int action,const struct menu_item_ex *this_item, |
312 | enum screen_type screen) | ||
311 | { | 313 | { |
312 | (void)this_item; | 314 | (void)this_item; |
315 | /* we save the old statusbar value here, so the old statusbars can get | ||
316 | * removed and cleared from the display properly on exiting | ||
317 | * (in gui_statusbar_changed() ) */ | ||
318 | static enum statusbar_values old_bar[NB_SCREENS]; | ||
313 | switch (action) | 319 | switch (action) |
314 | { | 320 | { |
321 | case ACTION_ENTER_MENUITEM: | ||
322 | #ifdef HAVE_REMOTE_LCD | ||
323 | if (screen == SCREEN_REMOTE) | ||
324 | old_bar[screen] = global_settings.remote_statusbar; | ||
325 | else | ||
326 | #endif | ||
327 | old_bar[screen] = global_settings.statusbar; | ||
328 | break; | ||
315 | case ACTION_EXIT_MENUITEM: | 329 | case ACTION_EXIT_MENUITEM: |
330 | gui_statusbar_changed(screen, old_bar[screen]); | ||
316 | send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL); | 331 | send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL); |
317 | send_event(GUI_EVENT_ACTIONUPDATE, (void*)true); | 332 | send_event(GUI_EVENT_ACTIONUPDATE, (void*)true); |
318 | break; | 333 | break; |
319 | } | 334 | } |
320 | return action; | 335 | return action; |
321 | } | 336 | } |
337 | |||
338 | #ifdef HAVE_REMOTE_LCD | ||
339 | static int statusbar_callback_remote(int action,const struct menu_item_ex *this_item) | ||
340 | { | ||
341 | return statusbar_callback_ex(action, this_item, SCREEN_REMOTE); | ||
342 | } | ||
343 | #endif | ||
344 | static int statusbar_callback(int action,const struct menu_item_ex *this_item) | ||
345 | { | ||
346 | return statusbar_callback_ex(action, this_item, SCREEN_MAIN); | ||
347 | } | ||
322 | MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL); | 348 | MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL); |
323 | MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL); | 349 | MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL); |
324 | MENUITEM_SETTING(statusbar, &global_settings.statusbar, statusbar_callback); | 350 | MENUITEM_SETTING(statusbar, &global_settings.statusbar, |
351 | statusbar_callback); | ||
325 | #ifdef HAVE_REMOTE_LCD | 352 | #ifdef HAVE_REMOTE_LCD |
326 | MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar, statusbar_callback); | 353 | MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar, |
354 | statusbar_callback_remote); | ||
327 | #endif | 355 | #endif |
328 | #if CONFIG_KEYPAD == RECORDER_PAD | 356 | #if CONFIG_KEYPAD == RECORDER_PAD |
329 | MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, NULL); | 357 | MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, NULL); |