summaryrefslogtreecommitdiff
path: root/gtk/gtkbutton.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-09-08 19:33:06 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-09-08 19:33:06 +0000
commit9ddcb3e07ec94a4526377d07e6f785e81d9166a0 (patch)
treefe22e908eba247683a67d6436b78f9bb67a5c61e /gtk/gtkbutton.c
parent9e1fc3a7babc6c6b611024a1856573ab12c65386 (diff)
downloadgtk+-9ddcb3e07ec94a4526377d07e6f785e81d9166a0.tar.gz
default xscale/yscale to 0.0, not 0.5, 0.5 isn't useful
2001-09-08 Havoc Pennington <hp@pobox.com> * gtk/gtkalignment.c (gtk_alignment_class_init): default xscale/yscale to 0.0, not 0.5, 0.5 isn't useful * tests/testtextbuffer.c: fix usage of gtk_text_iter_spew * gtk/gtktextiter.c: fix docs (gtk_text_iter_spew): get rid of this * gtk/gtklayout.c: docs * gtk/gtkbutton.c (gtk_button_construct_child): add an alignment to center image and label together, instead of having image on left and label centered, patch/suggestion from Jacob * gtk/gtkdialog.c: docs 2001-09-08 Havoc Pennington <hp@pobox.com> * gtk/tmpl/gtklayout.sgml: docs * gdk-pixbuf/gdk-pixbuf.sgml: remove the section on compiling gdk-pixbuf since it isn't a standalone package anymore * gtk/building.sgml: section on compiling GTK itself
Diffstat (limited to 'gtk/gtkbutton.c')
-rw-r--r--gtk/gtkbutton.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 61cafd9967..5d4a27a7b6 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -25,6 +25,7 @@
*/
#include <string.h>
+#include "gtkalignment.h"
#include "gtkbutton.h"
#include "gtklabel.h"
#include "gtkmain.h"
@@ -405,6 +406,7 @@ gtk_button_construct_child (GtkButton *button)
GtkWidget *label;
GtkWidget *image;
GtkWidget *hbox;
+ GtkWidget *align;
if (!button->constructed)
return;
@@ -425,13 +427,16 @@ gtk_button_construct_child (GtkButton *button)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (button));
image = gtk_image_new_from_stock (button->label_text, GTK_ICON_SIZE_BUTTON);
- hbox = gtk_hbox_new (FALSE, 1);
+ hbox = gtk_hbox_new (FALSE, 2);
+ align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
- gtk_box_pack_end (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- gtk_container_add (GTK_CONTAINER (button), hbox);
- gtk_widget_show_all (hbox);
+ gtk_container_add (GTK_CONTAINER (button), align);
+ gtk_container_add (GTK_CONTAINER (align), hbox);
+ gtk_widget_show_all (align);
return;
}