From 1f0908dfaf8bc88c5615a7e1751a0e08f2d7ca6c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 9 Oct 2004 20:54:15 +0000 Subject: [PATCH] Removed button bar for devices with no F buttons (Ondio) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5237 a1c6a512-1295-4272-9138-f99709370657 --- apps/menu.c | 8 +++++++- apps/settings.c | 2 ++ apps/settings_menu.c | 6 +++++- apps/status.c | 2 +- apps/tree.c | 2 ++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/apps/menu.c b/apps/menu.c index 53f60fdd25..2837974c9d 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -145,12 +145,14 @@ void menu_draw(int m) if (global_settings.statusbar) height -= STATUSBAR_HEIGHT; +#if CONFIG_KEYPAD == RECORDER_PAD if(global_settings.buttonbar && menus[m].use_buttonbar) { buttonbar_set(menus[m].buttonbar[0], menus[m].buttonbar[1], menus[m].buttonbar[2]); height -= BUTTONBAR_HEIGHT; } +#endif menu_lines = height / fh; @@ -196,9 +198,11 @@ void menu_draw(int m) height, menus[m].itemcount, menus[m].top, menus[m].top + menu_lines, VERTICAL); +#if CONFIG_KEYPAD == RECORDER_PAD if(global_settings.buttonbar && menus[m].use_buttonbar) buttonbar_draw(); -#endif +#endif /* CONFIG_KEYPAD == RECORDER_PAD */ +#endif /* HAVE_LCD_BITMAP */ status_draw(true); lcd_update(); @@ -280,12 +284,14 @@ int menu_show(int m) if (global_settings.statusbar) height -= STATUSBAR_HEIGHT; +#if CONFIG_KEYPAD == RECORDER_PAD if(global_settings.buttonbar && menus[m].use_buttonbar) { buttonbar_set(menus[m].buttonbar[0], menus[m].buttonbar[1], menus[m].buttonbar[2]); height -= BUTTONBAR_HEIGHT; } +#endif menu_lines = height / fh; #else diff --git a/apps/settings.c b/apps/settings.c index 04a0e3cd84..09e15b3deb 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -195,7 +195,9 @@ static const struct bit_entry rtc_bits[] = {1, S_O(invert_cursor), false, "invert cursor", off_on }, {1, S_O(statusbar), true, "statusbar", off_on }, {1, S_O(scrollbar), true, "scrollbar", off_on }, +#if CONFIG_KEYPAD == RECORDER_PAD {1, S_O(buttonbar), true, "buttonbar", off_on }, +#endif {1, S_O(volume_type), 0, "volume display", graphic_numeric }, {1, S_O(battery_type), 0, "battery display", graphic_numeric }, {1, S_O(timeformat), 0, "time format", "24hour,12hour" }, diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 099b912efe..35bc932455 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -957,11 +957,13 @@ static bool status_bar(void) return set_bool( str(LANG_STATUS_BAR), &global_settings.statusbar ); } +#if CONFIG_KEYPAD == RECORDER_PAD static bool button_bar(void) { return set_bool( str(LANG_BUTTON_BAR), &global_settings.buttonbar ); } -#endif +#endif /* CONFIG_KEYPAD == RECORDER_PAD */ +#endif /* HAVE_LCD_BITMAP */ static bool ff_rewind_settings_menu(void) { @@ -1175,7 +1177,9 @@ static bool bars_settings_menu(void) static const struct menu_item items[] = { { ID2P(LANG_SCROLL_BAR), scroll_bar }, { ID2P(LANG_STATUS_BAR), status_bar }, +#if CONFIG_KEYPAD == RECORDER_PAD { ID2P(LANG_BUTTON_BAR), button_bar }, +#endif { ID2P(LANG_VOLUME_DISPLAY), volume_type }, { ID2P(LANG_BATTERY_DISPLAY), battery_type }, }; diff --git a/apps/status.c b/apps/status.c index 248f9b9e1f..03badc5b75 100644 --- a/apps/status.c +++ b/apps/status.c @@ -267,7 +267,7 @@ void status_draw(bool force_redraw) } -#ifdef HAVE_LCD_BITMAP +#if defined(HAVE_LCD_BITMAP) && (CONFIG_KEYPAD == RECORDER_PAD) static void draw_buttonbar_btn(int num, const char* caption) { int xpos, ypos, button_width, text_width; diff --git a/apps/tree.c b/apps/tree.c index effb093b41..48de4a64aa 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -636,6 +636,7 @@ static int showdir(const char *path, int start, const int *dirfilter) tree_max_on_screen * line_height, filesindir, start, start + tree_max_on_screen, VERTICAL); +#if CONFIG_KEYPAD == RECORDER_PAD if(global_settings.buttonbar) { buttonbar_set(*dirfilter < NUM_FILTER_MODES ? str(LANG_DIRBROWSE_F1) : (unsigned char *) "", @@ -643,6 +644,7 @@ static int showdir(const char *path, int start, const int *dirfilter) str(LANG_DIRBROWSE_F3)); buttonbar_draw(); } +#endif #endif status_draw(true);