summaryrefslogtreecommitdiff
path: root/gtk/gtkoptionmenu.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-11-26 00:19:31 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-11-26 00:19:31 +0000
commitbc99cf97a2da79ee5ed33080af0ddb5cf16a8a81 (patch)
tree0c6a530219835ca8438120bf1b4e8a6bfbe307c5 /gtk/gtkoptionmenu.c
parent9a60bfac0c7342461430125098291c6b5d7550fc (diff)
downloadgtk+-bc99cf97a2da79ee5ed33080af0ddb5cf16a8a81.tar.gz
Calculate size based on the _child_ of the menu item, not the menuitem.
Sun Nov 25 18:59:19 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkoptionmenu.c (gtk_option_menu_calc_size): Calculate size based on the _child_ of the menu item, not the menuitem. (#65005, Damon Chaplin) * gtk/gtklistitem.c (gtk_list_item_new_with_label): Add some extra vertical padding to the label widget ... restores GTK+-1.2 spacing. (#65085, Damon Chaplin.)
Diffstat (limited to 'gtk/gtkoptionmenu.c')
-rw-r--r--gtk/gtkoptionmenu.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c
index 8e7856ce70..458a8fe431 100644
--- a/gtk/gtkoptionmenu.c
+++ b/gtk/gtkoptionmenu.c
@@ -848,10 +848,15 @@ gtk_option_menu_calc_size (GtkOptionMenu *option_menu)
if (GTK_WIDGET_VISIBLE (child))
{
- gtk_widget_size_request (child, &child_requisition);
+ GtkWidget *inner = GTK_BIN (child)->child;
- option_menu->width = MAX (option_menu->width, child_requisition.width);
- option_menu->height = MAX (option_menu->height, child_requisition.height);
+ if (inner)
+ {
+ gtk_widget_size_request (inner, &child_requisition);
+
+ option_menu->width = MAX (option_menu->width, child_requisition.width);
+ option_menu->height = MAX (option_menu->height, child_requisition.height);
+ }
}
}
}