aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Minko <vitaly.minko@gmail.com>2010-11-16 19:10:23 +0800
committerVitaly Minko <vitaly.minko@gmail.com>2010-11-16 19:10:23 +0800
commit8fd21279bc061f25da3cf74690d7cdb74844f6e3 (patch)
tree285d8d066ac8543127d443b8490a65621423942e
parent7e37089963000a4dcce907f2e4e8849bd0c97a06 (diff)
downloadgsoc2013-empathy-8fd21279bc061f25da3cf74690d7cdb74844f6e3.tar
gsoc2013-empathy-8fd21279bc061f25da3cf74690d7cdb74844f6e3.tar.gz
gsoc2013-empathy-8fd21279bc061f25da3cf74690d7cdb74844f6e3.tar.bz2
gsoc2013-empathy-8fd21279bc061f25da3cf74690d7cdb74844f6e3.tar.lz
gsoc2013-empathy-8fd21279bc061f25da3cf74690d7cdb74844f6e3.tar.xz
gsoc2013-empathy-8fd21279bc061f25da3cf74690d7cdb74844f6e3.tar.zst
gsoc2013-empathy-8fd21279bc061f25da3cf74690d7cdb74844f6e3.zip
Need to set preferred height of the search bar manually (#634688).
-rw-r--r--libempathy-gtk/empathy-search-bar.c16
1 files changed, 16 insertions, 0 deletions
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
@@ -58,6 +58,21 @@ empathy_search_bar_new (EmpathyChatView *view)
}
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;
}