Simplify the code and respect the show-button-images setting. (#307941,
2005-06-16 Matthias Clasen <mclasen@redhat.com> * gtk/gtkfilechooserdefault.c (button_new): Simplify the code and respect the show-button-images setting. (#307941, Vincent Noel)
This commit is contained in:
committed by
Matthias Clasen
parent
17441e5e7c
commit
2ee17f4875
@@ -1,5 +1,9 @@
|
||||
2005-06-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
2005-06-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
2005-06-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* 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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user