Enlightenment CVS committal Author : lordchaos Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_iconbox.c ewl_iconbox.h Log Message: Iconbox background changes to work with new object cache code. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -3 -r1.67 -r1.68 --- ewl_iconbox.c 10 Nov 2005 11:36:40 -0000 1.67 +++ ewl_iconbox.c 13 Nov 2005 07:59:31 -0000 1.68 @@ -346,29 +346,22 @@ void ewl_iconbox_background_set(Ewl_IconBox* ib, char* file) { /*Add a background image*/ - Ewl_Embed *emb; - emb = ewl_embed_widget_find(EWL_WIDGET(ib)); - if (emb && file) { - if (ib->background) evas_object_del(ib->background); - - ib->background = evas_object_image_add(emb->evas); - evas_object_image_file_set(ib->background, file, NULL); - - evas_object_clip_set(ib->background, EWL_WIDGET(ib)->fx_clip_box); - evas_object_move(ib->background, CURRENT_X(ib), CURRENT_Y(ib)); - evas_object_layer_set(ib->background, -1000); - - evas_object_image_fill_set(ib->background, 0,0, CURRENT_W(ib), CURRENT_H(ib)); - evas_object_resize(ib->background, CURRENT_W(ib), CURRENT_H(ib)); - - evas_object_show(ib->background); - } else if (file) { - printf("////////////////////////// Could not find top level widget\n"); - } else /*File is null*/ { - if (ib->background) evas_object_del(ib->background); + int w,h; - ib->background = NULL; + if (ib->background) { + ewl_widget_destroy(ib->background); } + + if (!file) return; + + w = CURRENT_W(ib->ewl_iconbox_pane_inner); + h= CURRENT_H(ib->ewl_iconbox_pane_inner); + + ib->background = ewl_image_new(); + ewl_object_custom_size_set(EWL_OBJECT(ib->background), w,h); + ewl_image_file_set(EWL_IMAGE(ib->background), file,0); + ewl_container_child_append(EWL_CONTAINER(ib->ewl_iconbox_pane_inner), ib->background); + ewl_widget_show(ib->background); } @@ -1089,17 +1082,17 @@ ewl_callback_del(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, ewl_iconbox_configure_cb); ewl_iconbox_inner_pane_calculate(EWL_ICONBOX(w)); ewl_iconbox_icon_arrange(ib); - ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, ewl_iconbox_configure_cb, NULL); - /*Handle the background, if any*/ if (ib->background) { - evas_object_clip_set(ib->background, EWL_WIDGET(ib)->fx_clip_box); - evas_object_move(ib->background, CURRENT_X(ib), CURRENT_Y(ib)); - evas_object_layer_set(ib->background, -1000); + int w,h; + w = CURRENT_W(ib->ewl_iconbox_pane_inner); + h= CURRENT_H(ib->ewl_iconbox_pane_inner); + ewl_object_custom_size_set(EWL_OBJECT(ib->background),w,h); - evas_object_image_fill_set(ib->background, 0,0, CURRENT_W(ib), CURRENT_H(ib)); - evas_object_resize(ib->background, CURRENT_W(ib), CURRENT_H(ib)); } + + ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, ewl_iconbox_configure_cb, NULL); + } } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- ewl_iconbox.h 30 Oct 2005 01:35:15 -0000 1.21 +++ ewl_iconbox.h 13 Nov 2005 07:59:31 -0000 1.22 @@ -89,7 +89,7 @@ int iw, ih; /*Custom icon width/height*/ /*Background*/ - Evas_Object* background; + Ewl_Widget* background; /* Objects for label editing..*/ Ewl_Widget* entry; ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs