[Pkg-e-commits] [SCM] Enlightenment DR17 toolkit based (based on the EFL) branch, upstream-vcs, updated. 447de88121d145a078f1754a0cfebb704d363821

pfritz pfritz at alioth.debian.org
Sat Jun 7 18:34:15 UTC 2008


The following commit has been merged in the upstream-vcs branch:
commit fb3bb14e1fd67868c17330f814aaaa9a22f89acb
Author: pfritz <pfritz>
Date:   Tue Apr 22 08:53:07 2008 +0000

    arrange the panes even if the paned was not visible before

diff --git a/src/lib/ewl_paned.c b/src/lib/ewl_paned.c
index 78016d8..a6948e7 100644
--- a/src/lib/ewl_paned.c
+++ b/src/lib/ewl_paned.c
@@ -57,8 +57,8 @@ static int ewl_paned_pane_info_setup(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
 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_paned_init(Ewl_Paned *p)
 	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 @@ ewl_paned_cb_child_hide(Ewl_Container *c, Ewl_Widget *w)
 
 /**
  * @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 @@ ewl_paned_cb_child_hide(Ewl_Container *c, Ewl_Widget *w)
  * 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 @@ ewl_paned_arrange(Ewl_Paned *p)
 		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 @@ ewl_paned_arrange(Ewl_Paned *p)
 	
 	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 @@ void
 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 @@ ewl_paned_pane_info_collect(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
 
 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);
diff --git a/src/lib/ewl_paned.h b/src/lib/ewl_paned.h
index 4641cef..bc2d238 100644
--- a/src/lib/ewl_paned.h
+++ b/src/lib/ewl_paned.h
@@ -95,7 +95,7 @@ int		 ewl_paned_initial_size_get(Ewl_Paned *p, Ewl_Widget *child);
 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.
diff --git a/src/lib/ewl_tree.c b/src/lib/ewl_tree.c
index 9ae583a..8f115c0 100644
--- a/src/lib/ewl_tree.c
+++ b/src/lib/ewl_tree.c
@@ -681,7 +681,7 @@ ewl_tree_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
 		 * 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 */

-- 
Enlightenment DR17 toolkit based (based on the EFL)



More information about the Pkg-e-commits mailing list