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
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
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 &&
// next
iter = pnd_box_get_next ( iter );
+ itercount++;
} // while
// dump categories
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
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
{ 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" },
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++ )
{
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 );
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 };
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 );
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++;