X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftint2;a=blobdiff_plain;f=src%2Futil%2Farea.c;h=dafd947773144ca34fb8846a385457a454159711;hp=adec3c9ae55da5720aa28179e0be3f132788f9d8;hb=c75069e03de761de15a6d74a4df0d7dbe6672b6e;hpb=bfc74d2e0eccdf838ab14a1e3843374ee0848038 diff --git a/src/util/area.c b/src/util/area.c index adec3c9..dafd947 100644 --- a/src/util/area.c +++ b/src/util/area.c @@ -116,6 +116,7 @@ void size_by_content (Area *a) 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; @@ -123,8 +124,9 @@ void size_by_content (Area *a) 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; } } } @@ -144,6 +146,7 @@ void size_by_layout (Area *a, int pos, int level) 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; @@ -164,6 +167,7 @@ void size_by_layout (Area *a, int pos, int level) if (pos != child->posx) { // pos changed => redraw child->posx = pos; + child->on_changed = 1; child->redraw = 1; } } @@ -171,6 +175,7 @@ void size_by_layout (Area *a, int pos, int level) if (pos != child->posy) { // pos changed => redraw child->posy = pos; + child->on_changed = 1; child->redraw = 1; } } @@ -183,6 +188,9 @@ void size_by_layout (Area *a, int pos, int level) else pos += child->height + a->paddingx; } + + if (a->on_changed && a->_on_change_layout) + a->_on_change_layout (a); }