Re: patch to make stock buttons look "nicer"



Hi,

Heh, I just finished doing something similar, I haven't tried it out
yet, waiting for a compile. So maybe I got it all ugly.

Havoc

Index: gtkbutton.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkbutton.c,v
retrieving revision 1.68
diff -u -p -u -r1.68 gtkbutton.c
--- gtkbutton.c 2001/09/03 06:45:17     1.68
+++ gtkbutton.c 2001/09/08 17:13:12
@@ -405,6 +405,7 @@ gtk_button_construct_child (GtkButton *b
   GtkWidget *label;
   GtkWidget *image;
   GtkWidget *hbox;
+  GtkWidget *align;
 
   if (!button->constructed)
     return;
@@ -427,10 +428,13 @@ gtk_button_construct_child (GtkButton *b
       image = gtk_image_new_from_stock (button->label_text,
     GTK_ICON_SIZE_BUTTON);
       hbox = gtk_hbox_new (FALSE, 1);
 
+      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_container_add (GTK_CONTAINER (button), hbox);
+      gtk_container_add (GTK_CONTAINER (button), align);
+      gtk_container_add (GTK_CONTAINER (align), hbox);
       gtk_widget_show_all (hbox);
 
       return;




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