size_by_content(l->data);
// calculate area's size
+ a->on_changed = 0;
if (a->resize && a->size_mode == SIZE_BY_CONTENT) {
a->resize = 0;
if (a->_resize(a)) {
// 'size' changed => 'resize = 1' on the parent and redraw object
((Area*)a->parent)->resize = 1;
+ a->on_changed = 1;
+ a->redraw = 1;
}
- a->redraw = 1;
}
}
}
if (a->_resize) {
if (a->_resize(a)) {
// if 'size' changed then 'resize = 1' on childs with SIZE_BY_LAYOUT
+ a->on_changed = 1;
for (l = a->list; l ; l = l->next) {
if (((Area*)l->data)->size_mode == SIZE_BY_LAYOUT)
((Area*)l->data)->resize = 1;
if (pos != child->posx) {
// pos changed => redraw
child->posx = pos;
+ child->on_changed = 1;
child->redraw = 1;
}
}
if (pos != child->posy) {
// pos changed => redraw
child->posy = pos;
+ child->on_changed = 1;
child->redraw = 1;
}
}
else
pos += child->height + a->paddingx;
}
+
+ if (a->on_changed && a->_on_change_layout)
+ a->_on_change_layout (a);
}
Area *child, *a = (Area*)obj;
int size, nb_by_content=0, nb_by_layout=0;
- printf("resize_by_layout\n");
if (panel_horizontal) {
// detect free size for SIZE_BY_LAYOUT's Area
size = a->width - (2 * (a->paddingxlr + a->bg->border.width));