From: skeezix Date: Sat, 20 Mar 2010 01:46:44 +0000 (-0400) Subject: Refining the skin a little X-Git-Tag: Release-2010-05/1~42 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b5eccba1cbca411d9007b1d56af5d06a972657c;p=pandora-libraries.git Refining the skin a little --- diff --git a/deployment/etc/pandora/conf/mmenu.conf b/deployment/etc/pandora/conf/mmenu.conf index a96014b..3530783 100644 --- a/deployment/etc/pandora/conf/mmenu.conf +++ b/deployment/etc/pandora/conf/mmenu.conf @@ -47,10 +47,11 @@ font_ptsize 16 tab_offset_x 4 # from left screen to first tab left tab_offset_y 3 # from top of screen to first tab top tab_width 132 # width of tab -tab_height 35 # height of tab +tab_height 35 # height of tab (for vertical clip) +tab_selheight 39 # height of tab when its selected (for vertical clip) text_offset_x 10 # from left edge of tab to left edge of text text_offset_y 10 # from top edge of tab to top edge of text -text_width 120 # clip text to this width +text_width 110 # clip text to this width [grid] font Vera.ttf @@ -112,6 +113,9 @@ IMG_SELECTED_ALPHAMASK select.png IMG_SELECTED_HILITE hilite.png IMG_TAB_SEL tab_sel_tall.png IMG_TAB_UNSEL tab_unsel.png +IMG_TAB_LINE tabline.png # line under the unselected tab, but not left/right corners +IMG_TAB_LINEL tablinel.png # line under unselected tab on far left +IMG_TAB_LINER tabliner.png # line under unselected tab on far right IMG_ICON_MISSING pandora60.png IMG_PREVIEW_MISSING pandora60.png IMG_ARROW_UP arrowup.png diff --git a/minimenu/TODO.txt b/minimenu/TODO.txt index 7566890..a2c3f3c 100644 --- a/minimenu/TODO.txt +++ b/minimenu/TODO.txt @@ -5,7 +5,6 @@ - libpnd: appdata-dir-name? -- mmwrapper black screen? - About screen - override - .desktop in same place as .pnd, override category diff --git a/minimenu/mmenu.c b/minimenu/mmenu.c index 279b57c..4230a29 100644 --- a/minimenu/mmenu.c +++ b/minimenu/mmenu.c @@ -355,11 +355,15 @@ void applications_scan ( void ) { pnd_log ( pndn_debug, "Found pnd applications, and caching icons:\n" ); pnd_disco_t *iter = pnd_box_get_head ( g_active_apps ); + unsigned int itercount = 0; while ( iter ) { //pnd_log ( pndn_debug, " App: '%s'\n", IFNULL(iter->title_en,"No Name") ); // update cachescreen - ui_cachescreen ( 1 /* clear screen */, IFNULL(iter->title_en,"No Name") ); + // ... every 5 filenames, just to avoid slowing it too much + if ( itercount % 5 == 0 ) { + ui_cachescreen ( 0 /* clear screen */, IFNULL(iter->title_en,"No Name") ); + } // cache the icon if ( iter -> pnd_icon_pos && @@ -433,6 +437,7 @@ void applications_scan ( void ) { // next iter = pnd_box_get_next ( iter ); + itercount++; } // while // dump categories diff --git a/minimenu/mmenu.conf b/minimenu/mmenu.conf index ee32d17..af4570c 100644 --- a/minimenu/mmenu.conf +++ b/minimenu/mmenu.conf @@ -47,10 +47,11 @@ font_ptsize 16 tab_offset_x 4 # from left screen to first tab left tab_offset_y 3 # from top of screen to first tab top tab_width 132 # width of tab -tab_height 35 # height of tab +tab_height 35 # height of tab (for vertical clip) +tab_selheight 39 # height of tab when its selected (for vertical clip) text_offset_x 10 # from left edge of tab to left edge of text text_offset_y 10 # from top edge of tab to top edge of text -text_width 120 # clip text to this width +text_width 110 # clip text to this width [grid] font Vera.ttf @@ -112,6 +113,9 @@ IMG_SELECTED_ALPHAMASK select.png IMG_SELECTED_HILITE hilite.png IMG_TAB_SEL tab_sel_tall.png IMG_TAB_UNSEL tab_unsel.png +IMG_TAB_LINE tabline.png # line under the unselected tab, but not left/right corners +IMG_TAB_LINEL tablinel.png # line under unselected tab on far left +IMG_TAB_LINER tabliner.png # line under unselected tab on far right IMG_ICON_MISSING pandora60.png IMG_PREVIEW_MISSING pandora60.png IMG_ARROW_UP arrowup.png diff --git a/minimenu/mmui.c b/minimenu/mmui.c index e764e00..68ae3c8 100644 --- a/minimenu/mmui.c +++ b/minimenu/mmui.c @@ -181,6 +181,9 @@ mm_imgcache_t g_imagecache [ IMG_TRUEMAX ] = { { IMG_SELECTED_ALPHAMASK, "graphics.IMG_SELECTED_ALPHAMASK" }, { IMG_TAB_SEL, "graphics.IMG_TAB_SEL" }, { IMG_TAB_UNSEL, "graphics.IMG_TAB_UNSEL" }, + { IMG_TAB_LINE, "graphics.IMG_TAB_LINE" }, + { IMG_TAB_LINEL, "graphics.IMG_TAB_LINEL" }, + { IMG_TAB_LINER, "graphics.IMG_TAB_LINER" }, { IMG_ICON_MISSING, "graphics.IMG_ICON_MISSING" }, { IMG_SELECTED_HILITE, "graphics.IMG_SELECTED_HILITE" }, { IMG_PREVIEW_MISSING, "graphics.IMG_PREVIEW_MISSING" }, @@ -347,16 +350,16 @@ void ui_render ( unsigned int render_mask ) { if ( g_imagecache [ IMG_TAB_SEL ].i && g_imagecache [ IMG_TAB_UNSEL ].i ) { unsigned int tab_width = pnd_conf_get_as_int ( g_conf, "tabs.tab_width" ); unsigned int tab_height = pnd_conf_get_as_int ( g_conf, "tabs.tab_height" ); + unsigned int tab_selheight = pnd_conf_get_as_int ( g_conf, "tabs.tab_selheight" ); unsigned int tab_offset_x = pnd_conf_get_as_int ( g_conf, "tabs.tab_offset_x" ); unsigned int tab_offset_y = pnd_conf_get_as_int ( g_conf, "tabs.tab_offset_y" ); unsigned int text_offset_x = pnd_conf_get_as_int ( g_conf, "tabs.text_offset_x" ); unsigned int text_offset_y = pnd_conf_get_as_int ( g_conf, "tabs.text_offset_y" ); unsigned int text_width = pnd_conf_get_as_int ( g_conf, "tabs.text_width" ); + unsigned int maxtab = ( screen_width / tab_width ) < g_categorycount ? ( screen_width / tab_width ) + ui_catshift : g_categorycount + ui_catshift; for ( col = ui_catshift; - col < ( - ( screen_width / tab_width ) < g_categorycount ? ( screen_width / tab_width ) + ui_catshift : g_categorycount + ui_catshift - ); + col < maxtab; col++ ) { @@ -371,7 +374,11 @@ void ui_render ( unsigned int render_mask ) { src.x = 0; src.y = 0; src.w = tab_width; - src.h = tab_height; + if ( col == ui_category ) { + src.h = tab_selheight; + } else { + src.h = tab_height; + } dest -> x = tab_offset_x + ( (col-ui_catshift) * tab_width ); dest -> y = tab_offset_y; //pnd_log ( pndn_debug, "tab %u at %ux%u\n", col, dest.x, dest.y ); @@ -382,6 +389,27 @@ void ui_render ( unsigned int render_mask ) { dest++; + // draw tab line + if ( col == ui_category ) { + // no line for selected tab + printf ( "skipselevting L\n" ); + } else { + if ( col - ui_catshift == 0 ) { + s = g_imagecache [ IMG_TAB_LINEL ].i; + printf ( "selevting L\n" ); + } else if ( col - ui_catshift == maxtab - 1 ) { + s = g_imagecache [ IMG_TAB_LINER ].i; + printf ( "selevting R\n" ); + } else { + s = g_imagecache [ IMG_TAB_LINE ].i; + printf ( "selevting M\n" ); + } + dest -> x = tab_offset_x + ( (col-ui_catshift) * tab_width ); + dest -> y = tab_offset_y + tab_height; + SDL_BlitSurface ( s, NULL /* whole image */, sdl_realscreen, dest ); + dest++; + } + // draw text SDL_Surface *rtext; SDL_Color tmpfontcolor = { font_rgba_r, font_rgba_g, font_rgba_b, font_rgba_a }; @@ -1400,6 +1428,7 @@ void ui_cachescreen ( unsigned char clearscreen, char *filename ) { SDL_Rect rects [ 4 ]; SDL_Rect *dest = rects; + SDL_Rect src; bzero ( dest, sizeof(SDL_Rect)* 4 ); unsigned int font_rgba_r = pnd_conf_get_as_int_d ( g_conf, "display.font_rgba_r", 200 ); @@ -1423,19 +1452,30 @@ void ui_cachescreen ( unsigned char clearscreen, char *filename ) { dest++; } - } + } else { + + // render background + if ( g_imagecache [ IMG_BACKGROUND_800480 ].i ) { + src.x = 0; + src.y = 0; + src.w = sdl_realscreen -> w; + src.h = 100; + dest -> x = 0; + dest -> y = 0; + dest -> w = sdl_realscreen -> w; + dest -> h = sdl_realscreen -> h; + SDL_BlitSurface ( g_imagecache [ IMG_BACKGROUND_800480 ].i, &src, sdl_realscreen, dest ); + dest++; + } + + } // clear it // render text SDL_Surface *rtext; SDL_Color tmpfontcolor = { font_rgba_r, font_rgba_g, font_rgba_b, font_rgba_a }; rtext = TTF_RenderText_Blended ( g_big_font, "Caching applications artwork...", tmpfontcolor ); - if ( clearscreen ) { - dest -> x = 20; - dest -> y = 20; - } else { - dest -> x = 20; - dest -> y = 40; - } + dest -> x = 20; + dest -> y = 20; SDL_BlitSurface ( rtext, NULL /* full src */, sdl_realscreen, dest ); SDL_FreeSurface ( rtext ); dest++; diff --git a/minimenu/mmui.h b/minimenu/mmui.h index a575f48..f06458d 100644 --- a/minimenu/mmui.h +++ b/minimenu/mmui.h @@ -18,6 +18,9 @@ typedef enum { IMG_SELECTED_ALPHAMASK, IMG_TAB_SEL, IMG_TAB_UNSEL, + IMG_TAB_LINE, + IMG_TAB_LINEL, + IMG_TAB_LINER, IMG_ICON_MISSING, IMG_SELECTED_HILITE, IMG_PREVIEW_MISSING, diff --git a/minimenu/skin/default/tab1mask.png b/minimenu/skin/default/tab1mask.png index 8cdd900..2aace85 100644 Binary files a/minimenu/skin/default/tab1mask.png and b/minimenu/skin/default/tab1mask.png differ diff --git a/minimenu/skin/default/tab_sel.png.bak b/minimenu/skin/default/tab_sel.png.bak deleted file mode 100644 index 3a444a6..0000000 Binary files a/minimenu/skin/default/tab_sel.png.bak and /dev/null differ diff --git a/minimenu/skin/default/tab_sel_tall.png b/minimenu/skin/default/tab_sel_tall.png index d8583f3..1d81f47 100644 Binary files a/minimenu/skin/default/tab_sel_tall.png and b/minimenu/skin/default/tab_sel_tall.png differ diff --git a/minimenu/skin/default/tabline.png b/minimenu/skin/default/tabline.png new file mode 100644 index 0000000..7504dad Binary files /dev/null and b/minimenu/skin/default/tabline.png differ diff --git a/minimenu/skin/default/tablinel.png b/minimenu/skin/default/tablinel.png new file mode 100644 index 0000000..6309273 Binary files /dev/null and b/minimenu/skin/default/tablinel.png differ diff --git a/minimenu/skin/default/tabliner.png b/minimenu/skin/default/tabliner.png new file mode 100644 index 0000000..4bb5329 Binary files /dev/null and b/minimenu/skin/default/tabliner.png differ