Enlightenment CVS committal Author : pfritz Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_paned.c ewl_paned.h Log Message: adjust preferred size on child resize =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_paned.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -3 -r1.67 -r1.68 --- ewl_paned.c 26 Feb 2008 06:21:21 -0000 1.67 +++ ewl_paned.c 21 Apr 2008 21:51:23 -0000 1.68 @@ -149,6 +149,8 @@ ewl_paned_cb_child_remove); ewl_container_show_notify_set(EWL_CONTAINER(p), ewl_paned_cb_child_show); + ewl_container_resize_notify_set(EWL_CONTAINER(p), + ewl_paned_cb_child_resize); ewl_container_hide_notify_set(EWL_CONTAINER(p), ewl_paned_cb_child_hide); @@ -424,6 +426,46 @@ ewl_object_preferred_inner_size_set(EWL_OBJECT(c), cw, ch); ewl_paned_grabbers_update(EWL_PANED(c)); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @internal + * @param c: The container to work with + * @param w: The widget to work with + * @return Returns no value + * @brief The child show callback + */ +void +ewl_paned_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size, + Ewl_Orientation o) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR(c); + DCHECK_PARAM_PTR(w); + DCHECK_TYPE(c, EWL_PANED_TYPE); + DCHECK_TYPE(w, EWL_WIDGET_TYPE); + + if (o == EWL_PANED(c)->orientation) + { + Ewl_Paned_Size_Info *info; + + info = ewl_paned_size_info_get(EWL_PANED(c), w); + if (!info || !info->initial_size_has) + { + if (o == EWL_ORIENTATION_HORIZONTAL) + ewl_object_preferred_inner_w_set( + EWL_OBJECT(c), PREFERRED_W(c) + + size); + else + ewl_object_preferred_inner_h_set( + EWL_OBJECT(c), PREFERRED_H(c) + + size); + } + } + else + ewl_container_largest_prefer(c, o); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_paned.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- ewl_paned.h 26 Dec 2007 16:31:59 -0000 1.34 +++ ewl_paned.h 21 Apr 2008 21:51:23 -0000 1.35 @@ -106,6 +106,8 @@ void ewl_paned_cb_child_add(Ewl_Container *c, Ewl_Widget *w); void ewl_paned_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx); void ewl_paned_cb_child_show(Ewl_Container *c, Ewl_Widget *w); +void ewl_paned_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size, + Ewl_Orientation o); void ewl_paned_cb_child_hide(Ewl_Container *c, Ewl_Widget *w); void ewl_paned_cb_configure(Ewl_Widget *w, void *ev, void *data); ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs