aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorHiroyuki Ikezoe <poincare@ikezoe.net>2006-06-02 18:10:29 +0800
committerHarish Krishnaswamy <kharish@src.gnome.org>2006-06-02 18:10:29 +0800
commitbda117750cd2db02093667af810fead5258988d5 (patch)
tree7d0bb3be512d82ee2f8f9843185f0366a829706c /widgets
parent00f6d32ee3dfa787029cbb1e925069d9f116749c (diff)
downloadgsoc2013-evolution-bda117750cd2db02093667af810fead5258988d5.tar.gz
gsoc2013-evolution-bda117750cd2db02093667af810fead5258988d5.tar.zst
gsoc2013-evolution-bda117750cd2db02093667af810fead5258988d5.zip
** Fixes bug 343494 Use gtk_button_set_image if GTK+ is 2.6 or higher.
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. svn path=/trunk/; revision=32067
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/ChangeLog6
-rw-r--r--widgets/misc/e-search-bar.c22
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);