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: Clean up background setting better =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- ewl_iconbox.c 18 Oct 2005 11:26:22 -0000 1.35 +++ ewl_iconbox.c 21 Oct 2005 11:13:31 -0000 1.36 @@ -149,6 +149,9 @@ } else { /*printf ("Bombed out on scrollpane creation\n");*/ } + + /*Start with an empty background*/ + ib->background = NULL; ib->ewl_iconbox_pane_inner = ewl_overlay_new(); ewl_container_child_append(EWL_CONTAINER(ib->ewl_iconbox_scrollpane), ib->ewl_iconbox_pane_inner); @@ -304,28 +307,39 @@ return selected; } +/*Move to the root of the scrollpame*/ +void ewl_scrollpane_goto_rood(Ewl_IconBox* ib) { + ewl_scrollpane_hscrollbar_value_set(EWL_SCROLLPANE(ib->ewl_iconbox_scrollpane),0); + ewl_scrollpane_vscrollbar_value_set(EWL_SCROLLPANE(ib->ewl_iconbox_scrollpane),0); + +} + 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) { - ib->background = evas_object_image_add(emb->evas); - evas_object_image_file_set(ib->background, file, NULL); + 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); - 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 { - printf("////////////////////////// Could not find top level widget\n"); - } + ib->background = NULL; } } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_iconbox.h 16 Oct 2005 23:06:21 -0000 1.12 +++ ewl_iconbox.h 21 Oct 2005 11:13:31 -0000 1.13 @@ -110,6 +110,7 @@ void ewl_iconbox_icon_arrange(Ewl_IconBox* ib); void ewl_iconbox_deselect_all(Ewl_IconBox* ib); Ewl_IconBox_Icon* ewl_iconbox_icon_add(Ewl_IconBox* iconbox, char* name, char* icon_file); +void ewl_scrollpane_goto_rood(Ewl_IconBox* ib); void ewl_iconbox_clear(Ewl_IconBox* iconbox); void ewl_iconbox_icon_image_set(Ewl_IconBox_Icon* icon, char* filename); void ewl_iconbox_background_set(Ewl_IconBox* ib, char* file); ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs