Enlightenment CVS committal

Author  : ningerso
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_grid.c 


Log Message:
Build up the grid preferred size on child show/hide.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_grid.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- ewl_grid.c  30 Sep 2006 18:41:01 -0000      1.29
+++ ewl_grid.c  2 Oct 2006 05:19:01 -0000       1.30
@@ -57,6 +57,10 @@
        ewl_container_add_notify_set(EWL_CONTAINER(g), ewl_grid_cb_child_add);
        ewl_container_remove_notify_set(EWL_CONTAINER(g), 
                                                ewl_grid_cb_child_remove);
+       ewl_container_show_notify_set(EWL_CONTAINER(g),
+                                               ewl_grid_cb_child_show);
+       ewl_container_hide_notify_set(EWL_CONTAINER(g),
+                                               ewl_grid_cb_child_show);
        ewl_container_resize_notify_set(EWL_CONTAINER(g),
                                                ewl_grid_cb_child_resize);
 
@@ -1474,7 +1478,7 @@
        *c = 0;
        *r = 0;
        
-       if (*g->map != 0) {
+       if (g->map && *g->map != 0) {
                if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
                        ewl_grid_hmap_position_next(g, c, r);
                else
@@ -1552,6 +1556,30 @@
        IF_FREE(g->map);
        g->map = NULL;
        g->data_dirty = TRUE;
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @internal
+ * @param p: The container to work with
+ * @param child: The widget to work with
+ * @param size: The new child size
+ * @param o: The orientation
+ * @return Returns no value
+ * @brief Catch notification of child shows.
+ */
+void
+ewl_grid_cb_child_show(Ewl_Container *p, Ewl_Widget *child)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("p", p);
+       DCHECK_PARAM_PTR("child", child);
+       DCHECK_TYPE("p", p, EWL_CONTAINER_TYPE);
+       DCHECK_TYPE("child", child, EWL_WIDGET_TYPE);
+
+       EWL_GRID(p)->data_dirty = TRUE;
+       ewl_grid_child_data_collect(EWL_GRID(p));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to