diff -u -r rockbox_svn.orig/apps/gui/icon.c rockbox_svn/apps/gui/icon.c --- rockbox_svn.orig/apps/gui/icon.c 2007-10-03 23:22:00.296875000 -0500 +++ rockbox_svn/apps/gui/icon.c 2007-10-03 23:02:19.250000000 -0500 @@ -267,3 +267,8 @@ { return ICON_WIDTH(screen_type); } + +int get_icon_height(enum screen_type screen_type) +{ + return ICON_HEIGHT(screen_type); +} diff -u -r rockbox_svn.orig/apps/gui/icon.h rockbox_svn/apps/gui/icon.h --- rockbox_svn.orig/apps/gui/icon.h 2007-07-19 18:38:26.593750000 -0500 +++ rockbox_svn/apps/gui/icon.h 2007-10-03 23:02:19.265625000 -0500 @@ -110,6 +110,7 @@ # define get_icon_width(a) 6 #else int get_icon_width(enum screen_type screen_type); +int get_icon_height(enum screen_type screen_type); #endif #endif /*_GUI_ICON_H_*/ diff -u -r rockbox_svn.orig/apps/gui/list.c rockbox_svn/apps/gui/list.c --- rockbox_svn.orig/apps/gui/list.c 2007-10-03 23:22:07.218750000 -0500 +++ rockbox_svn/apps/gui/list.c 2007-10-03 23:02:19.296875000 -0500 @@ -146,6 +146,15 @@ gui_list->cursor_flash_state=!gui_list->cursor_flash_state; int selected_line=gui_list->selected_item-gui_list->start_item+SHOW_LIST_TITLE; #ifdef HAVE_LCD_BITMAP + + int nb_lines; + bool use_custom_list=display->screen_type==SCREEN_MAIN && global_settings.listlines; + if (use_custom_list) { + nb_lines = global_settings.listlines; + } else { + nb_lines = display->nb_lines; + } + int line_ypos=display->getymargin()+display->char_height*selected_line; if (global_settings.cursor_style) { @@ -159,7 +168,7 @@ else { int cursor_xpos=(global_settings.scrollbar && - display->nb_lines < gui_list->nb_items)?1:0; + nb_lines < gui_list->nb_items)?1:0; screen_put_cursorxy(display, cursor_xpos, selected_line, gui_list->cursor_flash_state); } @@ -225,6 +234,8 @@ #endif int start, end; bool partial_draw = false; + int icon_width=get_icon_width(display->screen_type); + int icon_height=get_icon_height(display->screen_type); #ifdef HAVE_LCD_BITMAP switch (gui_list_context) /* Set appropriate font */ @@ -240,9 +251,19 @@ default: debugf("gui_list_put_selection_in_screen(): unknown font context: %i\n", gui_list_context); } + int width, height; + display->getstringsize((unsigned char *)"M", &width, &height); #endif gui_textarea_update_nblines(display); - + int nb_lines; + + bool use_custom_list=display->screen_type==SCREEN_MAIN && global_settings.listlines; + if (use_custom_list) { + nb_lines = global_settings.listlines; + } else { + nb_lines = gui_list->display->nb_lines; + } + /* Speed up UI by drawing the changed contents only. */ if (gui_list == last_list_displayed[gui_list->display->screen_type] && gui_list->last_displayed_start_item == gui_list->start_item @@ -251,7 +272,7 @@ partial_draw = true; } - lines = display->nb_lines - SHOW_LIST_TITLE; + lines = nb_lines - SHOW_LIST_TITLE; if (last_lines[display->screen_type] != lines) { gui_list_select_at_offset(gui_list, 0); @@ -277,7 +298,7 @@ { gui_textarea_clear(display); start = 0; - end = display->nb_lines; + end=nb_lines; gui_list->last_displayed_start_item = gui_list->start_item; last_list_displayed[gui_list->display->screen_type] = gui_list; } @@ -289,9 +310,21 @@ { if (gui_list->title_icon != NOICON && draw_icons) { - screen_put_icon(display, 0, 0, gui_list->title_icon); + if (use_custom_list) { #ifdef HAVE_LCD_BITMAP - text_pos = get_icon_width(display->screen_type)+2; /* pixels */ + int icon_pos_x=global_settings.listxpos; + int icon_pos_y=global_settings.listypos; + + if ( height > icon_height )/* center the cursor */ + icon_pos_y += (height - icon_height) / 2; + + screen_put_iconxy(display, icon_pos_x, icon_pos_y, gui_list->title_icon); +#endif + } else { + screen_put_icon(display, 0, 0, gui_list->title_icon); + } +#ifdef HAVE_LCD_BITMAP + text_pos = icon_width+2; /* pixels */ #else text_pos = 1; /* chars */ #endif @@ -310,10 +343,15 @@ title_style |= gui_list->title_color; } #endif - screen_set_xmargin(display, text_pos); /* margin for title */ + if (use_custom_list) { + display->setmargins(global_settings.listxpos+text_pos, global_settings.listxpos+text_pos+global_settings.listwidth, global_settings.listypos); + } else { + screen_set_xmargin(display, text_pos); /* margin for title */ + } + item_offset = gui_list_get_item_offset(gui_list, gui_list->title_width, text_pos); - if (item_offset > gui_list->title_width - (display->width - text_pos)) + if (item_offset > gui_list->title_width - (display->getrightmargin()-display->getleftmargin() - text_pos)) display->puts_style_offset(0, 0, gui_list->title, title_style, item_offset); else @@ -334,16 +372,17 @@ draw_cursor = !global_settings.cursor_style && gui_list->show_selection_marker; text_pos = 0; /* here it's in pixels */ + if(draw_scrollbar || SHOW_LIST_TITLE) /* indent if there's a title */ { text_pos += SCROLLBAR_WIDTH; } if(draw_cursor) - text_pos += get_icon_width(display->screen_type) + 2; + text_pos += icon_width + 2; if(draw_icons) - text_pos += get_icon_width(display->screen_type) + 2; + text_pos += icon_width + 2; #else draw_cursor = true; if(draw_icons) @@ -353,16 +392,21 @@ #endif #ifdef HAVE_LCD_BITMAP - screen_set_xmargin(display, text_pos); /* margin for list */ + if (use_custom_list) { + display->setmargins(global_settings.listxpos+text_pos, global_settings.listxpos+text_pos+global_settings.listwidth- + (draw_icons?icon_width:0)-(draw_scrollbar?SCROLLBAR_WIDTH:0), global_settings.listypos); + } else { + screen_set_xmargin(display, text_pos); + } #endif if (SHOW_LIST_TITLE) { start++; - if (end < display->nb_lines) + if (end < nb_lines) end++; } - + for (i = start; i < end; i++) { unsigned char *s; @@ -440,7 +484,7 @@ draw_cursor = false; } /* if the text is smaller than the viewport size */ - if (item_offset > item_width - (display->width - text_pos)) + if (item_offset > item_width - (display->getrightmargin()-display->getleftmargin() - text_pos)) { /* don't scroll */ display->puts_style_offset(0, i, entry_name, @@ -494,8 +538,19 @@ #ifdef HAVE_LCD_BITMAP int x = draw_cursor?1:0; int x_off = (draw_scrollbar || SHOW_LIST_TITLE) ? SCROLLBAR_WIDTH: 0; - screen_put_icon_with_offset(display, x, i, + + if (use_custom_list) { + int icon_pos_x=global_settings.listxpos+x_off; + int icon_pos_y=global_settings.listypos+i*height; + + if ( height > icon_height)/* center the cursor */ + icon_pos_y += (height - icon_height) / 2; + + screen_put_iconxy(display, icon_pos_x, icon_pos_y, icon); + } else { + screen_put_icon_with_offset(display, x, i, x_off, 0, icon); + } #else screen_put_icon(display, 1, i, icon); #endif @@ -507,16 +562,24 @@ /* Draw the scrollbar if needed*/ if(draw_scrollbar) { - int y_start = gui_textarea_get_ystart(display); - if (SHOW_LIST_TITLE) + int y_start = gui_textarea_get_ystart(display); + int x_start =0; + + if (use_custom_list) + { + y_start=global_settings.listypos; + x_start=global_settings.listxpos; + } + if (SHOW_LIST_TITLE) y_start += display->char_height; - int scrollbar_y_end = display->char_height * + int scrollbar_y_end = display->char_height * lines + y_start; - gui_scrollbar_draw(display, 0, y_start, SCROLLBAR_WIDTH-1, - scrollbar_y_end - y_start, gui_list->nb_items, - gui_list->start_item, - gui_list->start_item + lines, VERTICAL); - } + + gui_scrollbar_draw(display, x_start, y_start, SCROLLBAR_WIDTH-1, + scrollbar_y_end - y_start, gui_list->nb_items, + gui_list->start_item, + gui_list->start_item + lines, VERTICAL); + } screen_set_xmargin(display, old_margin); #endif @@ -669,7 +732,13 @@ static void gui_list_select_at_offset(struct gui_list * gui_list, int offset) { /* do this here instead of in both select_above and select_below */ - int nb_lines = gui_list->display->nb_lines; + bool use_custom_list=gui_list->display->screen_type==SCREEN_MAIN &&global_settings.listlines; + int nb_lines; + if (use_custom_list) { + nb_lines = global_settings.listlines; + } else { + nb_lines = gui_list->display->nb_lines; + } if (SHOW_LIST_TITLE) nb_lines--; @@ -727,7 +796,15 @@ } #endif gui_textarea_update_nblines(gui_list->display); - int nb_lines = gui_list->display->nb_lines; + int nb_lines; + struct screen * display=gui_list->display; + bool use_custom_list=display->screen_type==SCREEN_MAIN &&global_settings.listlines; + + if (use_custom_list) { + nb_lines = global_settings.listlines; + } else { + nb_lines = gui_list->display->nb_lines; + } int dist_selected_from_end = gui_list->nb_items - gui_list->selected_item - 1; @@ -876,18 +953,36 @@ enum screen_type screen) { int i; - FOR_NB_SCREENS(i) + FOR_NB_SCREENS(i){ + int nb_lines; + bool use_custom_list=screen==SCREEN_MAIN && global_settings.listlines; + if (use_custom_list) { + nb_lines = global_settings.listlines; + } else { + nb_lines = screens[screen].nb_lines; + } + gui_list_select_at_offset(&(lists->gui_list[i]), - screens[screen].nb_lines); + nb_lines); + } } static void gui_synclist_select_previous_page(struct gui_synclist * lists, enum screen_type screen) { int i; - FOR_NB_SCREENS(i) + FOR_NB_SCREENS(i){ + int nb_lines; + bool use_custom_list=screen==SCREEN_MAIN && global_settings.listlines; + if (use_custom_list) { + nb_lines = global_settings.listlines; + } else { + nb_lines = screens[screen].nb_lines; + } + gui_list_select_at_offset(&(lists->gui_list[i]), - -screens[screen].nb_lines); + -nb_lines); + } } void gui_synclist_add_item(struct gui_synclist * lists) Only in rockbox_svn/apps/gui: list.c.orig diff -u -r rockbox_svn.orig/apps/gui/quickscreen.c rockbox_svn/apps/gui/quickscreen.c --- rockbox_svn.orig/apps/gui/quickscreen.c 2007-10-03 23:22:07.250000000 -0500 +++ rockbox_svn/apps/gui/quickscreen.c 2007-10-03 23:02:19.312500000 -0500 @@ -73,10 +73,14 @@ /* Displays the first line of text */ option=(unsigned char *)option_select_get_text(qs->left_option); title=(unsigned char *)qs->left_option->title; - display->puts_scroll(2, puts_center-4+!statusbar, title); - display->puts_scroll(2, puts_center-3+!statusbar, option); - display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1, - putsxy_center-(font_h*3), 7, 8); + int ypos=puts_center-4; + if(ypos<0){ + ypos=0; + } + display->puts_scroll(2, ypos, title); + ypos++; + display->puts_scroll(2, ypos, option); + display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1, ypos*font_h, 7, 8); /* Displays the second line of text */ option=(unsigned char *)option_select_get_text(qs->right_option); @@ -84,21 +88,21 @@ display->getstringsize(title, &w, NULL); if(w > display->width - 8) { - display->puts_scroll(2, puts_center-2+!statusbar, title); + display->puts_scroll(2, puts_center-2, title); display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1, putsxy_center-font_h, 7, 8); } else { - display->putsxy(display->width - w - 12, putsxy_center-font_h, title); + display->putsxy(display->width - w - 12, putsxy_center-2*font_h, title); display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], display->width - 8, putsxy_center-font_h, 7, 8); } display->getstringsize(option, &w, NULL); if(w > display->width) - display->puts_scroll(0, puts_center-1+!statusbar, option); + display->puts_scroll(0, puts_center-1, option); else - display->putsxy(display->width -w-12, putsxy_center, option); + display->putsxy(display->width -w-12, putsxy_center-font_h, option); /* Displays the third line of text */ option=(unsigned char *)option_select_get_text(qs->bottom_option); @@ -106,13 +110,13 @@ display->getstringsize(title, &w, NULL); if(w > display->width) - display->puts_scroll(0, puts_bottom-4+!statusbar, title); + display->puts_scroll(0, puts_bottom-4, title); else display->putsxy(display->width/2-w/2, putsxy_bottom-(font_h*3), title); display->getstringsize(option, &w, NULL); if(w > display->width) - display->puts_scroll(0, puts_bottom-3+!statusbar, option); + display->puts_scroll(0, puts_bottom-3, option); else display->putsxy(display->width/2-w/2, putsxy_bottom-(font_h*2), option); display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], display->width/2-4, diff -u -r rockbox_svn.orig/apps/settings.c rockbox_svn/apps/settings.c --- rockbox_svn.orig/apps/settings.c 2007-10-03 23:22:07.750000000 -0500 +++ rockbox_svn/apps/settings.c 2007-10-03 23:02:19.328125000 -0500 @@ -292,6 +292,20 @@ global_settings.fg_color=LCD_DEFAULT_FG; global_settings.bg_color=LCD_DEFAULT_BG; #endif + global_settings.userfont1[0] = '\0'; + global_settings.userfont2[0] = '\0'; + global_settings.userfont3[0] = '\0'; + global_settings.userfont4[0] = '\0'; + global_settings.userfont5[0] = '\0'; + global_settings.userfont6[0] = '\0'; + global_settings.userfont7[0] = '\0'; + +#ifdef HAVE_LCD_BITMAP + global_settings.listxpos=0; + global_settings.listypos=0; + global_settings.listlines=0; + global_settings.listwidth=0; +#endif } bool settings_load_config(const char* file, bool apply) @@ -1102,13 +1116,6 @@ #if defined (HAVE_RECORDING) && CONFIG_CODEC == SWCODEC enc_global_settings_reset(); #endif - global_settings.userfont1[0] = '\0'; - global_settings.userfont2[0] = '\0'; - global_settings.userfont3[0] = '\0'; - global_settings.userfont4[0] = '\0'; - global_settings.userfont5[0] = '\0'; - global_settings.userfont6[0] = '\0'; - global_settings.userfont7[0] = '\0'; } /** Changing setting values **/ Only in rockbox_svn/apps: settings.c.orig diff -u -r rockbox_svn.orig/apps/settings.h rockbox_svn/apps/settings.h --- rockbox_svn.orig/apps/settings.h 2007-10-03 23:22:07.765625000 -0500 +++ rockbox_svn/apps/settings.h 2007-10-03 23:02:19.343750000 -0500 @@ -723,6 +723,14 @@ int fm_region; #endif bool audioscrobbler; /* Audioscrobbler logging */ + +#ifdef HAVE_LCD_BITMAP + /* custom coordinates/settings for the lists (Menus/File list) */ + int listxpos; + int listypos; + int listlines; + int listwidth; +#endif /* If values are just added to the end, no need to bump plugin API version. */ Only in rockbox_svn/apps: settings.h.orig diff -u -r rockbox_svn.orig/apps/settings_list.c rockbox_svn/apps/settings_list.c --- rockbox_svn.orig/apps/settings_list.c 2007-10-03 23:22:07.781250000 -0500 +++ rockbox_svn/apps/settings_list.c 2007-10-03 23:02:19.359375000 -0500 @@ -1254,6 +1254,14 @@ #endif #endif OFFON_SETTING(0,cuesheet,LANG_CUESHEET_ENABLE,false,"cuesheet support", NULL), + +#ifdef HAVE_LCD_BITMAP + {F_T_INT,&global_settings.listxpos,-1,INT(0),"listxpos",NULL,UNUSED}, + {F_T_INT,&global_settings.listypos,-1,INT(0),"listypos",NULL,UNUSED}, + {F_T_INT,&global_settings.listlines,-1,INT(0),"listlines",NULL,UNUSED}, + {F_T_INT,&global_settings.listwidth,-1,INT(0),"listwidth",NULL,UNUSED}, +#endif + CHOICE_SETTING(0, start_in_screen, LANG_START_SCREEN, 1, "start in screen", "previous,root,files,db,wps,menu," #ifdef HAVE_RECORDING Only in rockbox_svn/apps: settings_list.c.orig diff -u -r rockbox_svn.orig/firmware/drivers/lcd-16bit.c rockbox_svn/firmware/drivers/lcd-16bit.c --- rockbox_svn.orig/firmware/drivers/lcd-16bit.c 2007-10-03 23:22:24.937500000 -0500 +++ rockbox_svn/firmware/drivers/lcd-16bit.c 2007-10-03 23:18:27.531250000 -0500 @@ -880,13 +880,13 @@ if (style & STYLE_GRADIENT) { drawmode = DRMODE_FG; - lcd_gradient_rect(xpos, LCD_WIDTH, ypos, h*(style & STYLE_COLOR_MASK)); + lcd_gradient_rect(xpos, rightmargin, ypos, h*(style & STYLE_COLOR_MASK)); fg_pattern = lst_pattern; } else if (style & STYLE_COLORBAR) { drawmode = DRMODE_FG; fg_pattern = lss_pattern; - lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h); + lcd_fillrect(xpos, ypos, rightmargin - xpos, h); fg_pattern = lst_pattern; } else { @@ -1216,13 +1216,13 @@ /* Solid colour line selector */ drawmode = DRMODE_FG; fg_pattern = lss_pattern; - lcd_fillrect(0, ypos, LCD_WIDTH, pf->height); + lcd_fillrect(0, ypos, s->right_margin, pf->height); fg_pattern = lst_pattern; break; case STYLE_GRADIENT: /* Gradient line selector */ drawmode = DRMODE_FG; - lcd_gradient_rect(0, LCD_WIDTH, ypos, (signed)pf->height); + lcd_gradient_rect(0, s->right_margin, ypos, (signed)pf->height); fg_pattern = lst_pattern; break; default: