diff options
author | Soeren Sandmann <sandmann@daimi.au.dk> | 2003-07-26 13:22:42 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2003-07-26 13:22:42 +0000 |
commit | c9714692aad3ccc378f5bc36410521c56daf05dd (patch) | |
tree | 7d586c6fd75aade43a02f73fa01b2f4da0c99ce5 /gtk/gtkimagemenuitem.c | |
parent | 63f745738d41dd30d39d591a4e5eff6cc476c380 (diff) | |
download | gtk+-c9714692aad3ccc378f5bc36410521c56daf05dd.tar.gz |
don't request toggle_space when the image width is 0.
Sat Jul 26 15:21:27 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkimagemenuitem.c
(gtk_image_menu_item_toggle_size_request): don't request
toggle_space when the image width is 0.
Diffstat (limited to 'gtk/gtkimagemenuitem.c')
-rw-r--r-- | gtk/gtkimagemenuitem.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gtk/gtkimagemenuitem.c b/gtk/gtkimagemenuitem.c index 9dd1376d2a..60542d87dd 100644 --- a/gtk/gtkimagemenuitem.c +++ b/gtk/gtkimagemenuitem.c @@ -184,18 +184,22 @@ gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item, { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (menu_item); + *requisition = 0; + if (image_menu_item->image) { - guint toggle_spacing; + guint image_width = image_menu_item->image->requisition.width; - gtk_widget_style_get (GTK_WIDGET (menu_item), - "toggle_spacing", &toggle_spacing, - NULL); - - *requisition = image_menu_item->image->requisition.width + toggle_spacing; + if (image_width > 0) + { + guint toggle_spacing; + gtk_widget_style_get (GTK_WIDGET (menu_item), + "toggle_spacing", &toggle_spacing, + NULL); + + *requisition = image_width + toggle_spacing; + } } - else - *requisition = 0; } |