[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:11 UTC 2008


The following commit has been merged in the upstream-vcs branch:
commit 5f6c551e5433ac8a0929ed3d2c7f974f56b10c06
Author: pfritz <pfritz>
Date:   Mon Apr 21 21:51:23 2008 +0000

    adjust preferred size on child resize

diff --git a/src/lib/ewl_paned.c b/src/lib/ewl_paned.c
index f2234c5..70ae3d3 100644
--- a/src/lib/ewl_paned.c
+++ b/src/lib/ewl_paned.c
@@ -149,6 +149,8 @@ ewl_paned_init(Ewl_Paned *p)
 					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);
 
@@ -433,6 +435,46 @@ ewl_paned_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
  * @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);
+}
+
+/**
+ * @internal
+ * @param c: The container to work with
+ * @param w: The widget to work with
+ * @return Returns no value
  * @brief The child hide callback
  */
 void
diff --git a/src/lib/ewl_paned.h b/src/lib/ewl_paned.h
index 1941779..11b2442 100644
--- a/src/lib/ewl_paned.h
+++ b/src/lib/ewl_paned.h
@@ -106,6 +106,8 @@ void 			 ewl_paned_size_info_del(Ewl_Paned *p, Ewl_Widget *w);
 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);

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



More information about the Pkg-e-commits mailing list