]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Aha, _that's_ why there was some unexplained space on the RHS of the
authorSimon Tatham <anakin@pobox.com>
Sat, 29 Mar 2008 14:54:55 +0000 (14:54 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 29 Mar 2008 14:54:55 +0000 (14:54 +0000)
font selector: I had got the row and column counts in
gtk_table_new() back to front, so the space on the right was the
padding around five empty table columns! (And apparently a GtkTable
silently expands if you try to use rows that don't exist, which is
why I hadn't already noticed.)

Fixed that, and added some padding around the entire table. I think
my font selector is now finished, except for any bug fixes that come
up in testing.

[originally from svn r7954]

unix/gtkfont.c

index cc655622f9d70b985279a0b3f0b9aeba85e0dbb9..9ff0ad1c1c02976aaeb6ca1b41bb366805cccabf 100644 (file)
 #include "gtkfont.h"
 #include "tree234.h"
 
-/*
- * TODO on fontsel
- * ---------------
- * 
- *  - generalised style and padding polish
- *     + work out why the list boxes don't go all the way to the
- *      RHS of the dialog box
- * 
- *  - big testing and shakedown!
- */
-
 /*
  * Future work:
  * 
@@ -2058,11 +2047,16 @@ unifontsel *unifontsel_new(const char *wintitle)
      * Now set up the internal fields, including in particular all
      * the controls that actually allow the user to select fonts.
      */
-    table = gtk_table_new(3, 8, FALSE);
+    table = gtk_table_new(8, 3, FALSE);
     gtk_widget_show(table);
     gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+    /* GtkAlignment seems to be the simplest way to put padding round things */
+    w = gtk_alignment_new(0, 0, 1, 1);
+    gtk_alignment_set_padding(GTK_ALIGNMENT(w), 8, 8, 8, 8);
+    gtk_container_add(GTK_CONTAINER(w), table);
+    gtk_widget_show(w);
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(fs->u.window)->vbox),
-                      table, TRUE, TRUE, 0);
+                      w, TRUE, TRUE, 0);
 
     label = gtk_label_new_with_mnemonic("_Font:");
     gtk_widget_show(label);
@@ -2181,6 +2175,9 @@ unifontsel *unifontsel_new(const char *wintitle)
     fs->size_model = model;
     fs->size_list = w;
 
+    /*
+     * Preview widget.
+     */
     fs->preview_area = gtk_drawing_area_new();
     fs->preview_pixmap = NULL;
     fs->preview_width = 0;
@@ -2215,9 +2212,6 @@ unifontsel *unifontsel_new(const char *wintitle)
     gtk_table_attach(GTK_TABLE(table), w, 0, 3, 3, 4,
                     GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 8);
 
-    /*
-     * FIXME: preview widget
-     */
     i = 0;
     w = gtk_check_button_new_with_label("Show client-side fonts");
     gtk_object_set_data(GTK_OBJECT(w), "user-data",