Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_tree.c ewl_paned.c ewl_paned.h 


Log Message:
arrange the panes even if the paned was not visible before

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -3 -r1.68 -r1.69
--- ewl_tree.c  21 Apr 2008 23:22:23 -0000      1.68
+++ ewl_tree.c  22 Apr 2008 08:53:07 -0000      1.69
@@ -681,7 +681,7 @@
                 * position and its size to arrange correctly */
                ewl_object_x_request(EWL_OBJECT(tree->header), CURRENT_X(w));
                ewl_object_w_request(EWL_OBJECT(tree->header), CURRENT_W(w));
-               ewl_paned_arrange(EWL_PANED(tree->header));
+               ewl_paned_arrange(EWL_PANED(tree->header), tree->columns);
        }
 
        /* if the tree isn't dirty we're done */
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_paned.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- ewl_paned.c 21 Apr 2008 22:41:38 -0000      1.69
+++ ewl_paned.c 22 Apr 2008 08:53:07 -0000      1.70
@@ -57,8 +57,8 @@
 static int ewl_paned_pane_info_collect(Ewl_Paned *p, Ewl_Paned_Pane_Info 
*panes,
                Ewl_Paned_Layout *layout, int *resizable, int grabber_size);
 static void ewl_paned_pane_info_layout(Ewl_Paned *p, Ewl_Paned_Pane_Info 
*panes,
-                               Ewl_Paned_Layout *layout, int available,
-                               int resizable);
+                               int pane_num, Ewl_Paned_Layout *layout,
+                               int available, int resizable);
 
 static int ewl_paned_widgets_place(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes, 
                int grabber_size);
@@ -163,6 +163,7 @@
        ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_LEFT |
                                                EWL_FLAG_ALIGN_TOP);
        ewl_widget_focusable_set(w, FALSE);
+       p->new_panes = TRUE;
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
@@ -516,6 +517,7 @@
 
 /**
  * @param w: The paned to work with
+ * @param pane_num: The number of visible panes
  * @return Returns no value
  * @brief The arrange the child widgets
  *
@@ -526,12 +528,12 @@
  * what you are doing.
  */
 void
-ewl_paned_arrange(Ewl_Paned *p)
+ewl_paned_arrange(Ewl_Paned *p, int pane_num)
 {
        Ewl_Widget *w;
        Ewl_Container *c;
        Ewl_Paned_Pane_Info *panes;
-       int available, pane_num;
+       int available;
        int main_size, main_pos;
        int grabber_size, resizable = 0;
        int used_size;
@@ -556,9 +558,6 @@
                main_pos = CURRENT_Y(w);
        }
 
-       /* we need to now the number of panes */        
-       pane_num = (ewl_container_child_count_visible_get(c) + 1)/2;
-
        /* we cannot place the panes if there aren't any */
        if (pane_num <= 0)
                DRETURN(DLEVEL_STABLE);
@@ -579,7 +578,7 @@
        
        available = main_size - grabber_size * (pane_num - 1) - used_size;
 
-       ewl_paned_pane_info_layout(p, panes, layout, available, resizable);
+       ewl_paned_pane_info_layout(p, panes, pane_num, layout, available, 
resizable);
        /* now that all of the space is filled we can go and layout all of
         * the available widgets */
        used_size = ewl_paned_widgets_place(p, panes, grabber_size);
@@ -602,11 +601,15 @@
 ewl_paned_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
                                        void *data __UNUSED__)
 {
+       int pane_num;
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR(w);
        DCHECK_TYPE(w, EWL_PANED_TYPE);
 
-       ewl_paned_arrange(EWL_PANED(w));
+       /* we need to now the number of panes */        
+       pane_num = (ewl_container_child_count_visible_get(EWL_CONTAINER(w)) + 
1)/2;
+
+       ewl_paned_arrange(EWL_PANED(w), pane_num);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -788,11 +791,9 @@
 
 static void
 ewl_paned_pane_info_layout(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes, 
-                               Ewl_Paned_Layout *layout, int available, 
-                               int resizable)
+                               int pane_num, Ewl_Paned_Layout *layout, 
+                               int available, int resizable)
 {
-       int pane_num = 
-               (ewl_container_child_count_visible_get(EWL_CONTAINER(p)) + 1)/2;
        int cur_res = resizable;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_paned.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- ewl_paned.h 21 Apr 2008 22:41:38 -0000      1.36
+++ ewl_paned.h 22 Apr 2008 08:53:07 -0000      1.37
@@ -95,7 +95,7 @@
 void            ewl_paned_fixed_size_set(Ewl_Paned *p, Ewl_Widget *child,
                                                unsigned int fixed);
 unsigned int    ewl_paned_fixed_size_get(Ewl_Paned *p, Ewl_Widget *child);
-void            ewl_paned_arrange(Ewl_Paned *p);
+void            ewl_paned_arrange(Ewl_Paned *p, int pane_num);
 
 /*
  * Internal functions. Override at your risk.



-------------------------------------------------------------------------
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

Reply via email to