Index: apps/settings.c =================================================================== --- apps/settings.c (Revision 16791) +++ apps/settings.c (Arbeitskopie) @@ -263,6 +263,18 @@ return false; } +/* to maintain backwards compability */ +#ifdef HAVE_LCD_BITMAP +void theme_settings_reset(void) +{ + global_settings.listxpos=0; + global_settings.listypos=0; + global_settings.listheight=LCD_HEIGHT; + global_settings.listwidth=LCD_WIDTH; + +} +#endif + bool settings_load_config(const char* file, bool apply) { int fd; @@ -274,6 +286,11 @@ if (fd < 0) return false; + /* if loading a theme reset some settings for backward compatibility */ + if(strncmp(file, THEME_DIR, strlen(THEME_DIR))==0){ + theme_settings_reset(); + } + while (read_line(fd, line, sizeof line) > 0) { if (!settings_parseline(line, &name, &value)) Index: apps/gui/bitmap/list.c =================================================================== --- apps/gui/bitmap/list.c (Revision 16791) +++ apps/gui/bitmap/list.c (Arbeitskopie) @@ -40,6 +40,7 @@ #include "misc.h" #include "talk.h" #include "viewport.h" +//#include "debug.h" #define SCROLLBAR_WIDTH 6 #define ICON_PADDING 1 @@ -59,7 +60,9 @@ struct viewport *vp); bool list_display_title(struct gui_synclist *list, struct viewport *vp); -/* Draw the list... + +/* + Draw the list... internal screen layout: ----------------- |TI| title | TI is title icon @@ -78,7 +81,10 @@ if (!list_display_title(list, parent)) return false; *vp_text = *parent; + vp_text->x = global_settings.listxpos; + vp_text->y = global_settings.listypos + (global_settings.statusbar?STATUSBAR_HEIGHT:0); vp_text->height = list_title_height(list, parent); + vp_text->width = global_settings.listwidth; if (list->title_icon != Icon_NOICON && global_settings.show_icons) { *vp_icons = *vp_text; @@ -86,12 +92,15 @@ + ICON_PADDING*2; vp_icons->x += ICON_PADDING; - vp_text->width -= vp_icons->width + vp_icons->x; - vp_text->x += vp_icons->width + vp_icons->x; + vp_text->width -= vp_icons->width; + vp_text->x += vp_icons->width; display->set_viewport(vp_icons); screen_put_icon(display, 0, 0, list->title_icon); } + //DEBUGF("Global settings:\nx\t%d\ny\t%d\nwidth\t%d\nheight\t%d\n\n",global_settings.listxpos, + global_settings.listypos,global_settings.listwidth,global_settings.listheight); + //DEBUGF("Titel viewport:\nx\t%d\ny\t%d\nwidth\t%d\nheight\t%d\n\n",vp_text->x,vp_text->y,vp_text->width,vp_text->height); display->set_viewport(vp_text); vp_text->drawmode = STYLE_DEFAULT; #ifdef HAVE_LCD_COLOR @@ -126,23 +135,36 @@ list_text[display->screen_type].y += list_title_height(list, parent); list_text[display->screen_type].height -= list_title_height(list, parent); } - + list_text[display->screen_type].width = global_settings.listwidth; + list_text[display->screen_type].x = global_settings.listxpos; + list_text[display->screen_type].height = (global_settings.listheight - title_text->height); + list_text[display->screen_type].y = (title_text->y + title_text->height); + //DEBUGF("List Text:\nx\t%d\ny\t%d\nwidth\t%d\nheight\t%d\n\n",list_text[display->screen_type].x,list_text[display->screen_type].y,list_text[display->screen_type].width,list_text[display->screen_type].height); + start = list->start_item[display->screen_type]; end = start + viewport_get_nb_lines(&list_text[display->screen_type]); - + /* draw the scrollbar if its needed */ - if (global_settings.scrollbar && - viewport_get_nb_lines(&list_text[display->screen_type]) < list->nb_items) + bool draw_scrollbar = (global_settings.scrollbar && + viewport_get_nb_lines(&list_text[display->screen_type]) + < list->nb_items); + //DEBUGF("nb_items:\t%d\n",list->nb_items); + if (draw_scrollbar) { struct viewport vp; vp = list_text[display->screen_type]; + vp.x = (global_settings.listxpos) + 1; + list_text[display->screen_type].x += SCROLLBAR_WIDTH; + list_text[display->screen_type].width -= SCROLLBAR_WIDTH; + vp.y = (global_settings.listypos + title_text->height); vp.width = SCROLLBAR_WIDTH; - list_text[display->screen_type].width -= SCROLLBAR_WIDTH; - list_text[display->screen_type].x += SCROLLBAR_WIDTH; - vp.height = line_height * - viewport_get_nb_lines(&list_text[display->screen_type]); - vp.x = parent->x; + vp.height = global_settings.listheight - (title_text->height ); + /* shorten scrollbar to fit the lines */ + vp.height = line_height * + viewport_get_nb_lines(&list_text[display->screen_type]); + //DEBUGF("vp_get_nb_lines:\t%d\n",viewport_get_nb_lines(&list_text[display->screen_type])); display->set_viewport(&vp); + //DEBUGF("Scrollbar:\nx\t%d\ny\t%d\nwidth\t%d\nheight\t%d\n\n",vp.x,vp.y,vp.width,vp.height); gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1, vp.height, list->nb_items, list->start_item[display->screen_type], Index: apps/gui/list.c =================================================================== --- apps/gui/list.c (Revision 16791) +++ apps/gui/list.c (Arbeitskopie) @@ -38,6 +38,7 @@ #include "misc.h" #include "talk.h" #include "viewport.h" +//#include "debug.h" #ifdef HAVE_LCD_CHARCELLS #define SCROLL_LIMIT 1 @@ -232,6 +233,7 @@ struct viewport vp = *gui_list->parent[screen]; #ifdef HAVE_LCD_BITMAP if (list_display_title(gui_list, gui_list->parent[screen])) + vp.height = global_settings.listheight; vp.height -= list_title_height(gui_list,gui_list->parent[screen]); #endif nb_lines = viewport_get_nb_lines(&vp); Index: apps/settings.h =================================================================== --- apps/settings.h (Revision 16791) +++ apps/settings.h (Arbeitskopie) @@ -727,6 +727,14 @@ int keyclick_repeats; /* keyclick on repeats */ #endif unsigned char playlist_catalog_dir[MAX_FILENAME+1]; +#ifdef HAVE_LCD_BITMAP + /* custom coordinates/settings for the lists (Menus/File list) */ + int listxpos; + int listypos; + int listheight; + int listwidth; +#endif + }; /** global variables **/ Index: apps/settings_list.c =================================================================== --- apps/settings_list.c (Revision 16791) +++ apps/settings_list.c (Arbeitskopie) @@ -1149,6 +1149,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.listheight,-1,INT(LCD_HEIGHT),"listheight",NULL,UNUSED}, + {F_T_INT,&global_settings.listwidth,-1,INT(LCD_WIDTH),"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