From 2ee17f48758dd18eecaf1ebfb9b0f284f2b8a001 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 16 Jun 2005 16:44:08 +0000 Subject: [PATCH] Simplify the code and respect the show-button-images setting. (#307941, 2005-06-16 Matthias Clasen * gtk/gtkfilechooserdefault.c (button_new): Simplify the code and respect the show-button-images setting. (#307941, Vincent Noel) --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ gtk/gtkfilechooserdefault.c | 22 ++++------------------ 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9fb5aca76b..22eb1eddb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-06-16 Matthias Clasen + * gtk/gtkfilechooserdefault.c (button_new): Simplify + the code and respect the show-button-images setting. + (#307941, Vincent Noel) + * gtk/gtkdnd.c: Update the RGBA cursor if an icon is set after the cursor has been constructed. Also handle repeated setting of icons correctly. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9fb5aca76b..22eb1eddb6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2005-06-16 Matthias Clasen + * gtk/gtkfilechooserdefault.c (button_new): Simplify + the code and respect the show-button-images setting. + (#307941, Vincent Noel) + * gtk/gtkdnd.c: Update the RGBA cursor if an icon is set after the cursor has been constructed. Also handle repeated setting of icons correctly. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 9fb5aca76b..22eb1eddb6 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,9 @@ 2005-06-16 Matthias Clasen + * gtk/gtkfilechooserdefault.c (button_new): Simplify + the code and respect the show-button-images setting. + (#307941, Vincent Noel) + * gtk/gtkdnd.c: Update the RGBA cursor if an icon is set after the cursor has been constructed. Also handle repeated setting of icons correctly. diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 3b18ef0f01..e22587c50a 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -1874,29 +1874,15 @@ button_new (GtkFileChooserDefault *impl, GCallback callback) { GtkWidget *button; - GtkWidget *hbox; - GtkWidget *widget; - GtkWidget *align; + GtkWidget *image; - button = gtk_button_new (); - hbox = gtk_hbox_new (FALSE, 2); - align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); - - gtk_container_add (GTK_CONTAINER (button), align); - gtk_container_add (GTK_CONTAINER (align), hbox); - widget = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON); - - gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); - - widget = gtk_label_new_with_mnemonic (text); - gtk_label_set_mnemonic_widget (GTK_LABEL (widget), GTK_WIDGET (button)); - gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0); + button = gtk_button_new_with_mnemonic (text); + image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (button), GTK_IMAGE (image)); gtk_widget_set_sensitive (button, sensitive); g_signal_connect (button, "clicked", callback, impl); - gtk_widget_show_all (align); - if (show) gtk_widget_show (button);