Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
ewl_misc.c ewl_theme.c ewl_tree.c ewl_widget.c
Log Message:
Shuffled the stages of realize/show slightly, which should fix corner cases.
Hooked in the tree node container child hide callback.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- ewl_misc.c 24 Mar 2004 04:11:09 -0000 1.69
+++ ewl_misc.c 2 Jun 2004 18:55:27 -0000 1.70
@@ -639,9 +639,11 @@
* top.
*/
while ((w = ecore_list_remove_first(child_add_list))) {
- if (w->parent)
- ewl_container_call_child_show(EWL_CONTAINER(w->parent),
- w);
+ /*
+ * Check visibility in case the realize callback changed it.
+ */
+ if (VISIBLE(w))
+ ewl_widget_show(w);
}
ewl_exit_realize_phase();
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_theme.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- ewl_theme.c 24 Mar 2004 05:20:19 -0000 1.61
+++ ewl_theme.c 2 Jun 2004 18:55:28 -0000 1.62
@@ -352,7 +352,7 @@
if (w)
snprintf(key, PATH_MAX, "%s/%s", w->appearance, k);
else
- strcpy(key, k);
+ snprintf(key, PATH_MAX, "%s", k);
for (temp = key; temp && !ret; temp = strchr(temp, '/')) {
if (w && w->theme)
@@ -406,7 +406,7 @@
if (w)
snprintf(key, PATH_MAX, "%s/%s", w->appearance, k);
else
- strcpy(key, k);
+ snprintf(key, PATH_MAX, "%s", k);
for (temp = key; temp && !ret; temp = strchr(temp, '/')) {
if (w->theme)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- ewl_tree.c 31 May 2004 07:15:52 -0000 1.38
+++ ewl_tree.c 2 Jun 2004 18:55:36 -0000 1.39
@@ -472,6 +472,8 @@
ewl_container_show_notify(EWL_CONTAINER(node),
ewl_tree_node_child_show_cb);
+ ewl_container_hide_notify(EWL_CONTAINER(node),
+ ewl_tree_node_child_hide_cb);
ewl_container_resize_notify(EWL_CONTAINER(node),
ewl_tree_node_resize_cb);
ewl_container_remove_notify(EWL_CONTAINER(node),
@@ -558,7 +560,7 @@
Ewl_Tree_Node *node;
Ewl_Container *c;
Ewl_Object *child;
- int y, width;
+ int y;
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -575,6 +577,11 @@
child = ecore_list_next(c->children);
/*
+ printf("Tree node configured at (%d, %d) %d x %d\n", CURRENT_X(w),
+ CURRENT_Y(w), CURRENT_W(w), CURRENT_H(w));
+ */
+
+ /*
* The first child is the current level row
* are lower nodes and rows.
*/
@@ -582,15 +589,17 @@
CURRENT_W(w), ewl_object_get_preferred_h(child));
y = CURRENT_Y(w) + ewl_object_get_current_h(child);
- width = CURRENT_W(w) - CURRENT_X(w) + CURRENT_X(w);
/*
* All subsequent children are lower nodes and rows.
*/
while ((child = ecore_list_next(c->children))) {
- ewl_object_request_geometry(child, CURRENT_X(w), y, width,
- ewl_object_get_preferred_h(child));
- y += ewl_object_get_current_h(child);
+ if (VISIBLE(child)) {
+ ewl_object_request_geometry(child, CURRENT_X(w), y,
+ CURRENT_W(w),
+ ewl_object_get_preferred_h(child));
+ y += ewl_object_get_current_h(child);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -619,7 +628,6 @@
void
ewl_tree_node_child_show_cb(Ewl_Container *c, Ewl_Widget *w)
{
- int width;
Ewl_Tree_Node *node;
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -629,15 +637,15 @@
if (ecore_list_nodes(c->children) > 1)
ewl_widget_set_state(EWL_WIDGET(c), "expandable");
- if (node->expanded || w == node->row) {
+ if (node->expanded) {
+ ewl_container_prefer_sum(c, EWL_ORIENTATION_VERTICAL);
+ }
+ else {
ewl_object_set_preferred_h(EWL_OBJECT(c),
- PREFERRED_H(c) +
- ewl_object_get_preferred_h(EWL_OBJECT(w)));
+
ewl_object_get_preferred_h(EWL_OBJECT(node->row)));
}
- width = ewl_object_get_preferred_w(EWL_OBJECT(w));
- if (PREFERRED_W(c) < width)
- ewl_object_set_minimum_w(EWL_OBJECT(c), width);
+ ewl_container_prefer_largest(c, EWL_ORIENTATION_HORIZONTAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -3 -r1.113 -r1.114
--- ewl_widget.c 6 May 2004 15:43:11 -0000 1.113
+++ ewl_widget.c 2 Jun 2004 18:55:36 -0000 1.114
@@ -101,7 +101,6 @@
ewl_widget_realize(w->parent);
else if (w->parent || ewl_object_get_toplevel(EWL_OBJECT(w))) {
ewl_callback_call(w, EWL_CALLBACK_REALIZE);
- ewl_widget_show(w);
}
/*
@@ -160,6 +159,9 @@
if (REALIZED(w)) {
ewl_callback_call(w, EWL_CALLBACK_SHOW);
+ if (w->parent)
+ ewl_container_call_child_show(EWL_CONTAINER(w->parent),
+ w);
}
else if (pc) {
flags = ewl_object_get_flags(EWL_OBJECT(pc),
@@ -416,7 +418,7 @@
if (!w->appearance)
DRETURN(DLEVEL_STABLE);
- strcpy(w->appearance, appearance);
+ snprintf(w->appearance, al, "%s", appearance);
/*
* We don't throw away any inheritance info, so we can just allocate
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs