From bda117750cd2db02093667af810fead5258988d5 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 2 Jun 2006 10:10:29 +0000 Subject: ** Fixes bug 343494 Use gtk_button_set_image if GTK+ is 2.6 or higher. 2006-06-02 Hiroyuki Ikezoe ** Fixes bug 343494 * e-search-bar.c: (add_button): Use gtk_button_set_image if GTK+ is 2.6 or higher. svn path=/trunk/; revision=32067 --- widgets/misc/ChangeLog | 6 ++++++ widgets/misc/e-search-bar.c | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 798c8a882e..3bb4ebf787 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,9 @@ +2006-06-02 Hiroyuki Ikezoe + + ** Fixes bug 343494 + * e-search-bar.c: (add_button): Use gtk_button_set_image if GTK+ is + 2.6 or higher. + 2006-05-30 Li Yuan Fix for #343280. diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 275721dbe0..f0895dbdbb 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -743,14 +744,31 @@ add_button (ESearchBar *esb, GtkWidget *button; GtkWidget *image; +#if !GTK_CHECK_VERSION (2,6,0) + GtkWidget *hbox = gtk_hbox_new (FALSE, 2); + GtkWidget *label = gtk_label_new_with_mnemonic (text); + + gtk_misc_set_padding (GTK_MISC (label), 2, 0); +#endif + /* See the comment in `put_in_spacer_widget()' to understand why we have to do this. */ image = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON); button = gtk_button_new_with_mnemonic (text); - gtk_button_set_image (button, image); +#if GTK_CHECK_VERSION (2,6,0) + gtk_button_set_image (GTK_BUTTON (button), image); +#else + gtk_widget_show (image); + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0); + gtk_widget_show (hbox); + + button = gtk_button_new (); + gtk_container_add (GTK_CONTAINER (button), hbox); +#endif gtk_widget_show (button); - + holder = put_in_spacer_widget (button); gtk_widget_show (holder); -- cgit v1.2.3