- // if icon not in cache, and its a pnd-file source, perhaps try to load it right now..
- if ( ( ! ic ) &&
- ( load_visible ) &&
- ( ! ( appiter -> ref -> object_flags & PND_DISCO_GENERATED ) )
- )
- {
- // try to load any icons that..
- // - are not yet loaded
- // - did not fail a previous load attempt
- // this way user can upfront load all icons, or defer all icons, or even defer all icons
- // and still try to load visible ones 'just before needed'; so not at mmenu load time, but
- // as needed (only the ones needed.)
-
- if ( ( appiter -> ref -> pnd_icon_pos ) ||
- ( appiter -> ref -> icon && appiter -> ref -> object_flags & PND_DISCO_LIBPND_DD )
+ // show title text
+ if ( appiter -> ref -> title_en ) {
+ SDL_Surface *rtext;
+ rtext = TTF_RenderText_Blended ( g_grid_font, appiter -> ref -> title_en, c -> fontcolor );
+ src.x = 0;
+ src.y = 0;
+ src.w = hilight -> w; //c -> text_width < rtext -> w ? c -> text_width : rtext -> w;
+ src.h = rtext -> h;
+
+ dest -> x = c -> grid_offset_x + c -> text_clip_x;
+ dest -> x += 20; // so all title-text line up, regardless of icon presence
+#if 0
+ if ( ic ) {
+ dest -> x += 20; //((SDL_Surface*)ic -> i) -> w;
+ }
+#endif
+
+ dest -> y = c -> grid_offset_y + ( displayrow * ( c -> text_height + c -> icon_offset_y ) );
+ SDL_BlitSurface ( rtext, &src, sdl_realscreen, dest );
+ SDL_FreeSurface ( rtext );
+ dest++;
+ }
+
+ } // visible or scrolled?
+
+ if ( row >= ui_rows_scrolled_down ) {
+ displayrow++;
+ }
+
+ // are we done displaying rows?
+ if ( displayrow >= icon_visible_rows ) {
+ break;
+ }
+
+ appiter = appiter -> next;
+ row++;
+
+ } // while
+
+ } else {
+
+ appiter = g_categories [ ui_category ] -> refs;
+ row = 0;
+ displayrow = 0;
+
+ // until we run out of apps, or run out of space
+ while ( appiter != NULL ) {
+
+ for ( col = 0; col < c -> col_max && appiter != NULL; col++ ) {
+
+ // do we even need to render it? or are we suppressing it due to rows scrolled off the top?
+ if ( row >= ui_rows_scrolled_down ) {
+
+ // selected? show hilights
+ if ( appiter == ui_selected ) {
+ SDL_Surface *s = g_imagecache [ IMG_SELECTED_ALPHAMASK ].i;
+ // icon
+ //dest -> x = grid_offset_x + ( col * cell_width ) + icon_offset_x + ( ( icon_max_width - s -> w ) / 2 );
+ dest -> x = c -> grid_offset_x + ( col * c -> cell_width ) + c -> icon_offset_x + c -> sel_icon_offset_x;
+ //dest -> y = grid_offset_y + ( displayrow * cell_height ) + icon_offset_y + ( ( icon_max_height - s -> h ) / 2 );
+ dest -> y = c -> grid_offset_y + ( displayrow * c -> cell_height ) + c -> icon_offset_y + c -> sel_icon_offset_y;
+ SDL_BlitSurface ( s, NULL /* all */, sdl_realscreen, dest );
+ dest++;
+ // text
+ dest -> x = c -> grid_offset_x + ( col * c -> cell_width ) + c -> text_clip_x;
+ dest -> y = c -> grid_offset_y + ( displayrow * c -> cell_height ) + c -> text_hilite_offset_y;
+ SDL_BlitSurface ( g_imagecache [ IMG_SELECTED_HILITE ].i, NULL /* all */, sdl_realscreen, dest );
+ dest++;
+ } // selected?
+
+ // show icon
+ mm_cache_t *ic = cache_query_icon ( appiter -> ref -> unique_id );
+ SDL_Surface *iconsurface;
+
+ // if icon not in cache, and its a pnd-file source, perhaps try to load it right now..
+ if ( ( ! ic ) &&
+ ( load_visible ) &&
+ ( ! ( appiter -> ref -> object_flags & PND_DISCO_GENERATED ) )