Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_box.c ewl_notebook2.c Log Message: - change the box code to re-calc it's preferred inner size on orientation change. this means we don't have to fake it in notebook2 anymore =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_box.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ewl_box.c 12 Jan 2006 18:21:18 -0000 1.22 +++ ewl_box.c 3 Feb 2006 21:38:28 -0000 1.23 @@ -200,12 +200,14 @@ void ewl_box_orientation_set(Ewl_Box * b, Ewl_Orientation o) { + Ewl_Container *c; + Ewl_Widget *child; + char *appearance; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("b", b); DCHECK_TYPE("b", b, EWL_BOX_TYPE); - char *appearance; - /* * Set the orientation and reconfigure the widget so that child * widgets now have the new orientation layout @@ -223,11 +225,23 @@ if ((b->orientation == EWL_ORIENTATION_HORIZONTAL) && (!strcmp(appearance, "vbox"))) ewl_widget_appearance_set(EWL_WIDGET(b), "hbox"); + else if ((b->orientation == EWL_ORIENTATION_VERTICAL) && (!strcmp(appearance, "hbox"))) ewl_widget_appearance_set(EWL_WIDGET(b), "vbox"); + IF_FREE(appearance); + /* we need to reset the preferred size of the box after chaning the + * orientation. We'll cheat by calling ewl_box_child_show_cb foreach + * child in the list */ + ewl_object_preferred_inner_size_set(EWL_OBJECT(b), 0, 0); + + c = EWL_CONTAINER(b); + ecore_list_goto_first(c->children); + while((child = ecore_list_next(c->children))) + ewl_box_child_show_cb(c, child); + ewl_widget_configure(EWL_WIDGET(b)); DLEAVE_FUNCTION(DLEVEL_STABLE); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_notebook2.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_notebook2.c 3 Feb 2006 21:19:09 -0000 1.8 +++ ewl_notebook2.c 3 Feb 2006 21:38:28 -0000 1.9 @@ -135,33 +135,19 @@ { case EWL_POSITION_LEFT: case EWL_POSITION_RIGHT: - { - int h; - ewl_box_orientation_set(EWL_BOX(n), EWL_ORIENTATION_HORIZONTAL); ewl_box_orientation_set(EWL_BOX(n->body.tabbar), EWL_ORIENTATION_VERTICAL); - - h = ewl_object_preferred_inner_h_get(EWL_OBJECT(n)); - ewl_object_preferred_inner_h_set(EWL_OBJECT(n->body.tabbar), h); break; - } case EWL_POSITION_TOP: case EWL_POSITION_BOTTOM: default: - { - int w; - ewl_box_orientation_set(EWL_BOX(n), EWL_ORIENTATION_VERTICAL); ewl_box_orientation_set(EWL_BOX(n->body.tabbar), EWL_ORIENTATION_HORIZONTAL); - - w = ewl_object_preferred_inner_w_get(EWL_OBJECT(n)); - ewl_object_preferred_inner_w_set(EWL_OBJECT(n->body.tabbar), w); break; - } } ewl_container_child_remove(EWL_CONTAINER(n), n->body.tabbar); ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs