diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/ChangeLog | 6 | ||||
-rw-r--r-- | widgets/misc/e-search-bar.c | 22 |
2 files changed, 26 insertions, 2 deletions
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 <poincare@ikezoe.net> + + ** 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 <li.yuan@sun.com> 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 <gtk/gtkmenuitem.h> #include <gtk/gtkoptionmenu.h> #include <gtk/gtkmain.h> +#include <gtk/gtkversion.h> #include <misc/e-unicode.h> #include <misc/e-gui-utils.h> @@ -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); |