Mercurial > pidgin
diff console/libgnt/gntbox.c @ 13953:8b2306c64efa
[gaim-migrate @ 16501]
Minor adjustments to the packing of child widgets in a box.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 17 Jul 2006 04:30:50 +0000 |
parents | 25be562aaca8 |
children | c9509bd42d7a |
line wrap: on
line diff
--- a/console/libgnt/gntbox.c Mon Jul 17 03:45:24 2006 +0000 +++ b/console/libgnt/gntbox.c Mon Jul 17 04:30:50 2006 +0000 @@ -173,31 +173,30 @@ if (maxw < w) maxw = w; } - - if (box->homogeneous) + + for (iter = box->list; iter; iter = iter->next) { - for (iter = box->list; iter; iter = iter->next) - { - gnt_widget_set_size(GNT_WIDGET(iter->data), maxw, maxh); - } - } - else - { - for (iter = box->list; iter; iter = iter->next) + int w, h; + GntWidget *wid = GNT_WIDGET(iter->data); + + gnt_widget_get_size(wid, &w, &h); + + if (box->homogeneous) { if (box->vertical) - { - int h; - gnt_widget_get_size(GNT_WIDGET(iter->data), NULL, &h); - gnt_widget_set_size(GNT_WIDGET(iter->data), maxw, h); - } + h = maxh; else - { - int w; - gnt_widget_get_size(GNT_WIDGET(iter->data), &w, NULL); - gnt_widget_set_size(GNT_WIDGET(iter->data), w, maxh); - } + w = maxw; } + if (box->fill) + { + if (box->vertical) + w = maxw; + else + h = maxh; + } + + gnt_widget_set_size(wid, w, h); } reposition_children(widget); @@ -495,6 +494,7 @@ box->homogeneous = homo; box->vertical = vert; box->pad = 1; + box->fill = TRUE; gnt_widget_set_take_focus(widget, TRUE); GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); if (vert) @@ -669,3 +669,8 @@ } } +void gnt_box_set_fill(GntBox *box, gboolean fill) +{ + box->fill = fill; +} +