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-26 20:15:52.203125000 -0500 +++ rockbox_svn/apps/gui/icon.c 2007-10-26 21:08:07.515625000 -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-26 21:08:07.531250000 -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-26 20:25:52.578125000 -0500 +++ rockbox_svn/apps/gui/list.c 2007-10-26 21:08:07.546875000 -0500 @@ -189,6 +189,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 */ @@ -208,9 +210,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 @@ -219,7 +231,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); @@ -245,7 +257,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; } @@ -257,9 +269,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 + 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 = get_icon_width(display->screen_type)+2; /* pixels */ + text_pos = icon_width+2; /* pixels */ #else text_pos = 1; /* chars */ #endif @@ -278,10 +302,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 @@ -302,16 +331,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; if(draw_icons) - text_pos += get_icon_width(display->screen_type) + 2; + text_pos += icon_width + 2; + else + text_pos += 2; #else draw_cursor = true; if(draw_icons) @@ -321,16 +351,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+(!draw_scrollbar && !SHOW_LIST_TITLE?SCROLLBAR_WIDTH:0), global_settings.listxpos+text_pos+global_settings.listwidth- + (draw_icons?icon_width:0)-(SHOW_LIST_TITLE?SCROLLBAR_WIDTH:(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; @@ -408,7 +443,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, @@ -462,8 +497,22 @@ #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 ( !draw_scrollbar && !SHOW_LIST_TITLE) + icon_pos_x += SCROLLBAR_WIDTH; + + 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 @@ -475,16 +521,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 @@ -637,7 +691,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--; @@ -699,7 +759,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; @@ -854,18 +922,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) 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-26 20:25:52.593750000 -0500 +++ rockbox_svn/apps/gui/quickscreen.c 2007-10-26 21:38:43.015625000 -0500 @@ -50,6 +50,18 @@ */ static void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) { + int mfont_h; + display->setfont(FONT_MENU); + display->getstringsize("A", NULL, &mfont_h); + + int gsx = global_settings.listxpos; + int gsw = global_settings.listwidth; + int gsh = global_settings.listypos+global_settings.listlines*mfont_h; + int bgsx = (gsx?gsx-2:0); + + if (!gsh) gsh = display->height; + if (!gsw) gsw = display->width; + const unsigned char *option; const unsigned char *title; int w, font_h; @@ -62,8 +74,6 @@ { display->setfont(FONT_SYSFIXED); } - else - display->setfont(FONT_MENU); if(display->depth > 2) display->set_foreground(global_settings.fg_color); display->getstringsize("A", NULL, &font_h); @@ -72,15 +82,19 @@ const unsigned int puts_center = display->height/2/font_h; const unsigned int puts_bottom = display->height/font_h; const unsigned int putsxy_center = display->height/2; - const unsigned int putsxy_bottom = display->height; + const unsigned int putsxy_bottom = gsh; /* 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(gsx/6+2, ypos, title); + ypos++; + display->puts_scroll(gsx/6+2, ypos, option); + display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], bgsx+1, ypos*font_h, 7, 8); /* Displays the second line of text */ option=(unsigned char *)option_select_get_text(qs->right_option); @@ -88,21 +102,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(gsx+gsw - 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); + gsx+gsw - 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(gsx+gsw -w-12, putsxy_center-font_h, option); /* Displays the third line of text */ option=(unsigned char *)option_select_get_text(qs->bottom_option); @@ -110,15 +124,15 @@ 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->putsxy(gsx+gsw/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->putsxy(gsx+gsw/2-w/2, putsxy_bottom-(font_h*2), option); display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], display->width/2-4, putsxy_bottom-font_h, 7, 8); Only in rockbox_svn/apps/gui: quickscreen.c.orig diff -u -r rockbox_svn.orig/apps/settings.c rockbox_svn/apps/settings.c --- rockbox_svn.orig/apps/settings.c 2007-10-26 20:25:53.125000000 -0500 +++ rockbox_svn/apps/settings.c 2007-10-26 21:08:07.593750000 -0500 @@ -291,6 +291,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) @@ -1101,13 +1115,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 **/ diff -u -r rockbox_svn.orig/apps/settings.h rockbox_svn/apps/settings.h --- rockbox_svn.orig/apps/settings.h 2007-10-26 20:25:53.140625000 -0500 +++ rockbox_svn/apps/settings.h 2007-10-26 21:08:07.609375000 -0500 @@ -714,6 +714,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-26 20:25:53.156250000 -0500 +++ rockbox_svn/apps/settings_list.c 2007-10-26 21:08:07.625000000 -0500 @@ -1246,6 +1246,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 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-26 21:39:08.984375000 -0500 +++ rockbox_svn/firmware/drivers/lcd-16bit.c 2007-10-26 21:08:07.656250000 -0500 @@ -880,20 +880,17 @@ 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 { lcd_fillrect(xpos + w, ypos, rightmargin - (xpos + w), h); - if (LCD_WIDTH>rightmargin) { - lcd_fillrect(rightmargin, ypos, LCD_WIDTH - rightmargin, h); - } drawmode = (style & STYLE_INVERT) ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; } @@ -1212,13 +1209,13 @@ /* Solid colour line selector */ drawmode = DRMODE_FG; fg_pattern = lss_pattern; - lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); + lcd_fillrect(xpos, ypos, s->right_margin - xpos, pf->height); fg_pattern = lst_pattern; break; case STYLE_GRADIENT: /* Gradient line selector */ drawmode = DRMODE_FG; - lcd_gradient_rect(xpos, LCD_WIDTH, ypos, (signed)pf->height); + lcd_gradient_rect(xpos, s->right_margin, ypos, (signed)pf->height); fg_pattern = lst_pattern; break; default: