mmenu; larger font in list view; added to config file and config menu; default folders
[pandora-libraries.git] / minimenu / mmcache.c
index 73b2392..941aa74 100644 (file)
 #include "mmcache.h"
 #include "mmcat.h"
 #include "mmui.h"
+#include "mmui_context.h"
 
 extern pnd_conf_handle g_conf;
 extern unsigned char g_pvwcache;
 extern pnd_conf_handle g_desktopconf;
+SDL_Surface *ui_scale_image ( SDL_Surface *s, unsigned int maxwidth, int maxheight ); // height -1 means ignore
 
 mm_cache_t *g_icon_cache = NULL;
 mm_cache_t *g_preview_cache = NULL;
@@ -346,6 +348,11 @@ unsigned char cache_icon ( pnd_disco_t *app, unsigned char maxwidth, unsigned ch
     s = scaled;
   }
 
+  // scale for tiny?
+  SDL_Surface *scaled_tiny = SDL_ConvertSurface ( s, s -> format, s -> flags );
+  extern ui_context_t ui_display_context;
+  scaled_tiny = ui_scale_image ( scaled_tiny, -1 , ui_display_context.text_height );
+
   // add to cache
   c = (mm_cache_t*) malloc ( sizeof(mm_cache_t) );
   bzero ( c, sizeof(mm_cache_t) );
@@ -359,6 +366,7 @@ unsigned char cache_icon ( pnd_disco_t *app, unsigned char maxwidth, unsigned ch
 
   strncpy ( c -> uniqueid, app -> unique_id, 1000 );
   c -> i = s;
+  c -> itiny = scaled_tiny;
 
   return ( 1 );
 }