summaryrefslogtreecommitdiffstats
path: root/apps/menus/display_menu.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-23 23:44:31 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-23 23:44:31 +0000
commit19f44a61cfb333c363d823e43b5de282ef2d2ed0 (patch)
tree77aeee29551bc99be86adc39f43436ebc4bda5f1 /apps/menus/display_menu.c
parent7dfec97c5d0c0295403bb97570a5f524b2cb26b4 (diff)
downloadrockbox-19f44a61cfb333c363d823e43b5de282ef2d2ed0.tar.gz
rockbox-19f44a61cfb333c363d823e43b5de282ef2d2ed0.tar.bz2
rockbox-19f44a61cfb333c363d823e43b5de282ef2d2ed0.zip
Fix redraw issues when the statusbar setting was changed with an UI viewport. Now the old statusbar area is cleared upon changing the setting.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22484 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menus/display_menu.c')
-rw-r--r--apps/menus/display_menu.c34
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 @@
#include "screens.h"
#endif
#include "viewport.h"
+#include "statusbar.h" /* statusbar_vals enum*/
#ifdef HAVE_BACKLIGHT
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,
/***********************************/
/* BARS MENU */
#ifdef HAVE_LCD_BITMAP
-static int statusbar_callback(int action,const struct menu_item_ex *this_item)
+static int statusbar_callback_ex(int action,const struct menu_item_ex *this_item,
+ enum screen_type screen)
{
(void)this_item;
+ /* we save the old statusbar value here, so the old statusbars can get
+ * removed and cleared from the display properly on exiting
+ * (in gui_statusbar_changed() ) */
+ static enum statusbar_values old_bar[NB_SCREENS];
switch (action)
{
+ case ACTION_ENTER_MENUITEM:
+#ifdef HAVE_REMOTE_LCD
+ if (screen == SCREEN_REMOTE)
+ old_bar[screen] = global_settings.remote_statusbar;
+ else
+#endif
+ old_bar[screen] = global_settings.statusbar;
+ break;
case ACTION_EXIT_MENUITEM:
+ gui_statusbar_changed(screen, old_bar[screen]);
send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
send_event(GUI_EVENT_ACTIONUPDATE, (void*)true);
break;
}
return action;
}
+
+#ifdef HAVE_REMOTE_LCD
+static int statusbar_callback_remote(int action,const struct menu_item_ex *this_item)
+{
+ return statusbar_callback_ex(action, this_item, SCREEN_REMOTE);
+}
+#endif
+static int statusbar_callback(int action,const struct menu_item_ex *this_item)
+{
+ return statusbar_callback_ex(action, this_item, SCREEN_MAIN);
+}
MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL);
MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL);
-MENUITEM_SETTING(statusbar, &global_settings.statusbar, statusbar_callback);
+MENUITEM_SETTING(statusbar, &global_settings.statusbar,
+ statusbar_callback);
#ifdef HAVE_REMOTE_LCD
-MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar, statusbar_callback);
+MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar,
+ statusbar_callback_remote);
#endif
#if CONFIG_KEYPAD == RECORDER_PAD
MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, NULL);