diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-08-25 00:29:27 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-08-25 00:29:27 -0400 |
commit | e1143c2d455b24e23d63739d259c799762ebcaa1 (patch) | |
tree | 768f5fe972b2b713ca0bc19c540f1569080d8ac8 | |
parent | 06c2777d88629304a6d9df10ca0fb09b39093211 (diff) | |
download | gtk+-e1143c2d455b24e23d63739d259c799762ebcaa1.tar.gz |
Make empty buttonboxes work again
There was some less than careful / nvis_children.
-rw-r--r-- | gtk/gtkbbox.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c index ceab527b88..e5c128fa56 100644 --- a/gtk/gtkbbox.c +++ b/gtk/gtkbbox.c @@ -460,8 +460,8 @@ gtk_button_box_child_requisition (GtkWidget *widget, avg_h += child_requisition.height + ipad_h; } } - avg_w /= nchildren; - avg_h /= nchildren; + avg_w /= MAX (nchildren, 1); + avg_h /= MAX (nchildren, 1); *widths = g_new (gint, nchildren); *heights = g_new (gint, nchildren); @@ -484,9 +484,7 @@ gtk_button_box_child_requisition (GtkWidget *widget, gtk_widget_get_child_requisition (child, &child_requisition); - if (homogeneous || - (child_requisition.width + ipad_w < avg_w * 1.5)) /* && - child_requisition.width + ipad_w > avg_w / 1.5)) */ + if (homogeneous || (child_requisition.width + ipad_w < avg_w * 1.5)) { (*widths)[i] = -1; if (child_requisition.width + ipad_w > needed_width) @@ -497,9 +495,7 @@ gtk_button_box_child_requisition (GtkWidget *widget, (*widths)[i] = child_requisition.width + ipad_w; } - if (homogeneous || - (child_requisition.height + ipad_h < avg_h * 1.5)) /* && - child_requisition.height + ipad_h > avg_h / 1.5)) */ + if (homogeneous || (child_requisition.height + ipad_h < avg_h * 1.5)) { (*heights)[i] = -1; if (child_requisition.height + ipad_h > needed_height) |