Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_icon.c Log Message: - make the icons thumbnail =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_icon.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ewl_icon.c 30 May 2006 23:54:27 -0000 1.16 +++ ewl_icon.c 6 Sep 2006 16:19:01 -0000 1.17 @@ -122,24 +122,35 @@ void ewl_icon_image_set(Ewl_Icon *icon, const char *file, const char *key) { + Ewl_Widget *img; + int constrain = 16; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("icon", icon); DCHECK_PARAM_PTR("file", file); DCHECK_TYPE("icon", icon, EWL_ICON_TYPE); - if (!icon->preview) + if (icon->preview) { - icon->preview = ewl_image_new(); - ewl_image_proportional_set(EWL_IMAGE(icon->preview), TRUE); - ewl_object_alignment_set(EWL_OBJECT(icon->preview), - EWL_FLAG_ALIGN_CENTER); - ewl_widget_internal_set(icon->preview, TRUE); - ewl_container_child_prepend(EWL_CONTAINER(icon), - icon->preview); - ewl_widget_show(icon->preview); + constrain = ewl_icon_constrain_get(icon); + ewl_widget_destroy(icon->preview); } - ewl_image_file_set(EWL_IMAGE(icon->preview), file, key); + img = ewl_image_new(); + ewl_image_file_set(EWL_IMAGE(img), file, key); + + icon->preview = ewl_image_thumbnail_get(EWL_IMAGE(img)); + ewl_image_proportional_set(EWL_IMAGE(icon->preview), TRUE); + ewl_image_constrain_set(EWL_IMAGE(icon->preview), constrain); + ewl_image_file_set(EWL_IMAGE(icon->preview), + ewl_icon_theme_icon_path_get( + EWL_ICON_IMAGE_LOADING, NULL), + EWL_ICON_IMAGE_LOADING); + ewl_object_alignment_set(EWL_OBJECT(icon->preview), + EWL_FLAG_ALIGN_CENTER); + ewl_widget_internal_set(icon->preview, TRUE); + ewl_container_child_prepend(EWL_CONTAINER(icon), icon->preview); + ewl_widget_show(icon->preview); DLEAVE_FUNCTION(DLEVEL_STABLE); } ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs