[gucharmap] Respect the button-images setting



commit 633a9734a48080266d29a7fda8020ede32d41cb5
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 18 01:30:18 2009 -0400

    Respect the button-images setting
    
    Streamline the construction of some buttons, with the positive side-effect
    of making them respect the button-images setting. See bug 588734.

 gucharmap/gucharmap-search-dialog.c |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/gucharmap/gucharmap-search-dialog.c b/gucharmap/gucharmap-search-dialog.c
index 34c475f..cf650e9 100644
--- a/gucharmap/gucharmap-search-dialog.c
+++ b/gucharmap/gucharmap-search-dialog.c
@@ -711,22 +711,12 @@ set_button_stock_image_and_label (GtkButton *button,
                                   gchar     *stock_id,
                                   gchar     *mnemonic)
 {
-  GtkWidget *hbox, *image, *label, *align;
-
-  align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
-  gtk_container_add (GTK_CONTAINER (button), align);
-
-  hbox = gtk_hbox_new (FALSE, 2);
-  gtk_container_add (GTK_CONTAINER (align), hbox);
+  GtkWidget *image;
 
   image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
-  gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
-
-  label = gtk_label_new_with_mnemonic (mnemonic);
-  gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (button));
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-
-  gtk_widget_show_all (align);
+  gtk_button_set_image (button, image);
+  gtk_button_set_label (button, mnemonic);
+  gtk_button_set_use_underline (button, TRUE);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]