Index: deskbar/iconentry/ephy-icon-entry.c =================================================================== RCS file: /cvs/gnome/deskbar-applet/deskbar/iconentry/ephy-icon-entry.c,v retrieving revision 1.1 diff -p -u -u -p -r1.1 ephy-icon-entry.c --- deskbar/iconentry/ephy-icon-entry.c 13 Sep 2005 23:35:00 -0000 1.1 +++ deskbar/iconentry/ephy-icon-entry.c 5 Oct 2005 13:47:24 -0000 @@ -24,10 +24,12 @@ * See the ChangeLog in the gtk+ distribution files for a list of changes. * These files are distributed with GTK+ at ftp://ftp.gtk.org/pub/gtk/. * - * $Id: ephy-icon-entry.c,v 1.1 2005/09/13 23:35:00 rslinckx Exp $ + * $Id: ephy-icon-entry.c,v 1.4 2005/08/07 20:31:32 chpe Exp $ */ +#ifndef COMPILING_TESTICONENTRY #include "config.h" +#endif #include "ephy-icon-entry.h" @@ -228,6 +230,7 @@ ephy_icon_entry_size_allocate (GtkWidget GtkContainer *container = GTK_CONTAINER (widget); GtkBin *bin = GTK_BIN (widget); GtkAllocation child_allocation; + GtkRequisition requisition; int xborder, yborder; widget->allocation = *allocation; @@ -248,10 +251,21 @@ ephy_icon_entry_size_allocate (GtkWidget child_allocation.height); } + gtk_widget_get_child_requisition (widget, &requisition); + child_allocation.x = container->border_width + xborder; - child_allocation.y = container->border_width + yborder; + child_allocation.y = container->border_width + yborder + + (widget->allocation.height - requisition.height) / 2; child_allocation.width = MAX (allocation->width - (container->border_width + xborder) * 2, 0); child_allocation.height = MAX (allocation->height - (container->border_width + yborder) * 2, 0); + + /* We have to set the size requisition on the GtkEntry explicitly, + * since otherwise it'll end up too tall if someone uses + * gtk_widget_set_size_request on this EphyIconEntry, + * because gtk_entry_size_allocate checks its size with + * gtk_widget_get_child_requisition. + */ + gtk_widget_set_size_request (entry->entry, -1, child_allocation.height); gtk_widget_size_allocate (bin->child, &child_allocation); }