From 8fd21279bc061f25da3cf74690d7cdb74844f6e3 Mon Sep 17 00:00:00 2001 From: Vitaly Minko Date: Tue, 16 Nov 2010 14:10:23 +0300 Subject: Need to set preferred height of the search bar manually (#634688). --- libempathy-gtk/empathy-search-bar.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libempathy-gtk/empathy-search-bar.c') diff --git a/libempathy-gtk/empathy-search-bar.c b/libempathy-gtk/empathy-search-bar.c index 9a27795a2..51a79096a 100644 --- a/libempathy-gtk/empathy-search-bar.c +++ b/libempathy-gtk/empathy-search-bar.c @@ -57,6 +57,21 @@ empathy_search_bar_new (EmpathyChatView *view) return GTK_WIDGET (self); } +static void +empathy_search_bar_get_preferred_height (GtkWidget *widget, + gint *minimun_height, + gint *natural_height) +{ + GtkBin *bin; + GtkWidget *child; + + bin = GTK_BIN (widget); + child = gtk_bin_get_child (bin); + + if (child && gtk_widget_get_visible (child)) + gtk_widget_get_preferred_height (child, minimun_height, natural_height); +} + static void empathy_search_bar_size_allocate (GtkWidget *widget, GtkAllocation *allocation) @@ -290,6 +305,7 @@ empathy_search_bar_class_init (EmpathySearchBarClass *class) g_type_class_add_private (gobject_class, sizeof (EmpathySearchBarPriv)); /* Neither GtkBin nor GtkContainer seems to do this for us :( */ + widget_class->get_preferred_height = empathy_search_bar_get_preferred_height; widget_class->size_allocate = empathy_search_bar_size_allocate; } -- cgit v1.2.3