[balsa/gtk4: 254/284] balsa-print: Build with gtk4




commit 583e7dd0ae36040fff01413f18e58b0230348cdf
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Nov 18 10:30:46 2020 -0500

    balsa-print: Build with gtk4
    
    modified:   src/balsa-print-object-default.c
    modified:   src/balsa-print-object-header.c
    modified:   src/balsa-print-object-text.c
    modified:   src/balsa-print-object.c
    modified:   src/balsa-print-object.h
    modified:   src/print-gtk.c

 src/balsa-print-object-default.c | 46 ++++++++++---------
 src/balsa-print-object-header.c  | 26 +++--------
 src/balsa-print-object-text.c    | 39 ++++++++++------
 src/balsa-print-object.c         | 77 +++++++-------------------------
 src/balsa-print-object.h         |  2 +-
 src/print-gtk.c                  | 96 ++++++++++++++++++++--------------------
 6 files changed, 122 insertions(+), 164 deletions(-)
---
diff --git a/src/balsa-print-object-default.c b/src/balsa-print-object-default.c
index 70a811344..82273d862 100644
--- a/src/balsa-print-object-default.c
+++ b/src/balsa-print-object-default.c
@@ -81,25 +81,27 @@ balsa_print_object_default_destroy(GObject * self)
 
 
 GList *
-balsa_print_object_default(GList                          *list,
-                                                  GtkPrintContext         *context,
-                                                  LibBalsaMessageBody *body,
-                                                  BalsaPrintSetup     *psetup)
+balsa_print_object_default(GList               *list,
+                           GtkPrintContext     *context,
+                           LibBalsaMessageBody *body,
+                           BalsaPrintSetup     *psetup)
 {
-       GdkPixbuf *pixbuf;
-       gint p_label_width;
+    GdkPixbuf *pixbuf;
+    int p_label_width;
     PangoFontDescription *header_font;
     PangoLayout *test_layout;
-    gchar *conttype;
+    char *conttype;
     GString *desc_buf;
-    gchar *part_desc;
-    gchar *description;
+    char *part_desc;
+    char *description;
 
-    g_return_val_if_fail((context != NULL) && (body != NULL) && (psetup != NULL), list);
+    g_return_val_if_fail(context != NULL, list);
+    g_return_val_if_fail(body != NULL, list);
+    g_return_val_if_fail(psetup != NULL, list);
 
     /* get a pixbuf according to the mime type */
     conttype = libbalsa_message_body_get_mime_type(body);
-    pixbuf = libbalsa_icon_finder(NULL, conttype, NULL, NULL, GTK_ICON_SIZE_DND);
+    pixbuf = libbalsa_icon_finder(conttype, NULL, NULL);
 
     /* create a layout for calculating the maximum label width */
     header_font = pango_font_description_from_string(balsa_app.print_header_font);
@@ -144,11 +146,11 @@ balsa_print_object_default(GList                     *list,
 
 GList *
 balsa_print_object_default_full(GList           *list,
-                                                               GtkPrintContext *context,
-                                                               GdkPixbuf       *pixbuf,
-                                                               const gchar     *description,
-                                                               gint             p_label_width,
-                                                               BalsaPrintSetup *psetup)
+                                GtkPrintContext *context,
+                                GdkPixbuf       *pixbuf,
+                                const gchar     *description,
+                                gint             p_label_width,
+                                BalsaPrintSetup *psetup)
 {
     BalsaPrintObjectDefault *pod;
     BalsaPrintObject *po;
@@ -161,7 +163,10 @@ balsa_print_object_default_full(GList           *list,
     GList *this_par_part;
     gdouble c_at_y;
 
-       g_return_val_if_fail((context != NULL) && (pixbuf != NULL) && (description != NULL) && (psetup != 
NULL), list);
+    g_return_val_if_fail(context != NULL, list);
+    g_return_val_if_fail(pixbuf != NULL, list);
+    g_return_val_if_fail(description != NULL, list);
+    g_return_val_if_fail(psetup != NULL, list);
 
     pod = g_object_new(BALSA_TYPE_PRINT_OBJECT_DEFAULT, NULL);
     g_assert(pod != NULL);
@@ -251,8 +256,8 @@ balsa_print_object_default_draw(BalsaPrintObject * self,
 {
     BalsaPrintObjectDefault *pod;
     const BalsaPrintRect *rect;
-    gdouble c_max_height;
-    gdouble c_offset;
+    double c_max_height;
+    double c_offset;
     PangoLayout *layout;
     PangoFontDescription *font;
     PangoTabArray *tabs;
@@ -266,9 +271,8 @@ balsa_print_object_default_draw(BalsaPrintObject * self,
     c_offset = pod->c_image_width + 4 * C_LABEL_SEP;
 
     /* print the icon */
-    if (pod->pixbuf != NULL) {
+    if (pod->pixbuf != NULL)
         cairo_print_pixbuf(cairo_ctx, pod->pixbuf, rect->c_at_x, rect->c_at_y, 1.0);
-    }
 
     /* print the description */
     font = pango_font_description_from_string(balsa_app.print_header_font);
diff --git a/src/balsa-print-object-header.c b/src/balsa-print-object-header.c
index dfaf8a973..dca613ea2 100644
--- a/src/balsa-print-object-header.c
+++ b/src/balsa-print-object-header.c
@@ -156,9 +156,8 @@ balsa_print_object_header_new_real(GList * list,
                    headers->dispnotify_to, &p_label_width, print_all_headers);
 
     /* user headers */
-    p = g_list_first(headers->user_hdrs);
     face = NULL;
-    while (p) {
+    for (p = headers->user_hdrs; p != NULL; p = p->next) {
        gchar **pair, *curr_hdr;
 
        pair = p->data;
@@ -168,27 +167,14 @@ balsa_print_object_header_new_real(GList * list,
        g_free(curr_hdr);
 
        /* check for face and x-face */
-       if (!face) {
-           GError *err = NULL;
-           GtkWidget * f_widget = NULL;
-
-           if (!g_ascii_strcasecmp("Face", pair[0]))
-               f_widget = libbalsa_get_image_from_face_header(pair[1], &err);
+       if (face == NULL) {
+           if (g_ascii_strcasecmp("Face", pair[0]) == 0)
+               face = libbalsa_get_pixbuf_from_face_header(pair[1], NULL);
 #if HAVE_COMPFACE
-           else if (!g_ascii_strcasecmp("X-Face", pair[0]))
-               f_widget = libbalsa_get_image_from_x_face_header(pair[1], &err);
+           else if (g_ascii_strcasecmp("X-Face", pair[0]) == 0)
+               face = libbalsa_get_pixbuf_from_x_face_header(pair[1], NULL);
 #endif                          /* HAVE_COMPFACE */
-           if (err)
-               g_error_free(err);
-
-           if (f_widget) {
-               face = g_object_ref(gtk_image_get_pixbuf(GTK_IMAGE(f_widget)));
-               gtk_window_destroy(GTK_WINDOW(f_widget));
-           }
        }
-
-       /* next */
-       p = g_list_next(p);
     }
 
     /* add a small space between label and value */
diff --git a/src/balsa-print-object-text.c b/src/balsa-print-object-text.c
index d0d61d951..573649b4d 100644
--- a/src/balsa-print-object-text.c
+++ b/src/balsa-print-object-text.c
@@ -361,23 +361,36 @@ balsa_print_object_text(GList *list, GtkPrintContext * context,
 }
 
 static GdkPixbuf *
-get_icon(const gchar         *icon_name,
-                LibBalsaMessageBody *body)
+get_icon(const char          *icon_name,
+         LibBalsaMessageBody *body)
 {
-    gint width;
-    gint height;
+    GtkIconTheme *theme = gtk_icon_theme_get_for_display(gdk_display_get_default());
     GdkPixbuf *pixbuf;
 
-    if (!gtk_icon_size_lookup(GTK_ICON_SIZE_DND, &width, &height)) {
-        width = 16;
-    }
-
-    pixbuf = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), icon_name, width, 
GTK_ICON_LOOKUP_FORCE_SIZE, NULL);
-    if (pixbuf == NULL) {
-       gchar *conttype = libbalsa_message_body_get_mime_type(body);
+    if (gtk_icon_theme_has_icon(theme, icon_name)) {
+        int *sizes;
+        int *s;
+        int size = 0;
+        GtkIconPaintable *info;
+
+        sizes = gtk_icon_theme_get_icon_sizes(theme, icon_name);
+        for (s = sizes; *s != 0; s++) {
+            if (*s == -1 || *s >= 32) {
+                size = 32; /* GTK_ICON_SIZE_DND */
+                break;
+            }
+            size = MAX(size, *s);
+        }
+        g_free(sizes);
 
-       pixbuf = libbalsa_icon_finder(NULL, conttype, NULL, NULL, GTK_ICON_SIZE_DND);
-       g_free(conttype);
+        info = gtk_icon_theme_lookup_icon(theme, icon_name, NULL, size, 1, GTK_TEXT_DIR_NONE,
+                                          (GtkIconLookupFlags) 0);
+        pixbuf = gdk_pixbuf_get_from_texture(GDK_TEXTURE(info));
+        g_object_unref(info);
+    } else {
+        char *conttype = libbalsa_message_body_get_mime_type(body);
+        pixbuf = libbalsa_icon_finder(conttype, NULL, NULL);
+        g_free(conttype);
     }
 
     return pixbuf;
diff --git a/src/balsa-print-object.c b/src/balsa-print-object.c
index 3ab55591e..02372fdf6 100644
--- a/src/balsa-print-object.c
+++ b/src/balsa-print-object.c
@@ -271,79 +271,34 @@ p_string_height_from_layout(PangoLayout * layout, const gchar * text)
 /* print a GdkPixbuf to cairo at the specified position and with the
  * specified scale */
 gboolean
-cairo_print_pixbuf(cairo_t * cairo_ctx, const GdkPixbuf * pixbuf,
-                  gdouble c_at_x, gdouble c_at_y, gdouble scale)
+cairo_print_pixbuf(cairo_t   *cairo_ctx,
+                   GdkPixbuf *pixbuf,
+                   double    c_at_x,
+                   double    c_at_y,
+                   double    scale)
 {
-    guchar *raw_image;
-    gint n_chans;
-    guint32 *surface_buf;
-    gint width;
-    gint height;
-    gint rowstride;
-    guint32 *dest;
-    cairo_format_t format;
-    cairo_surface_t *surface;
+    int n_chans;
+    int width;
+    int height;
     cairo_pattern_t *pattern;
     cairo_matrix_t matrix;
 
     /* paranoia checks */
-    g_return_val_if_fail(cairo_ctx && pixbuf, FALSE);
-
-    /* must have 8 bpp */
-    g_return_val_if_fail(gdk_pixbuf_get_bits_per_sample(pixbuf) == 8,
-                        FALSE);
+    g_return_val_if_fail(cairo_ctx != NULL, FALSE);
+    g_return_val_if_fail(pixbuf != NULL, FALSE);
 
     /* must have 3 (no alpha) or 4 (with alpha) channels */
     n_chans = gdk_pixbuf_get_n_channels(pixbuf);
     g_return_val_if_fail(n_chans == 3 || n_chans == 4, FALSE);
 
-    /* allocate a new buffer */
-    /* FIXME: does this work on 64 bit machines if the witdth is odd? */
-    width = gdk_pixbuf_get_width(pixbuf);
+    width  = gdk_pixbuf_get_width(pixbuf);
     height = gdk_pixbuf_get_height(pixbuf);
-    if (!(surface_buf = g_new0(guint32, width * height)))
-       return FALSE;
-
-    /* copy pixbuf to a cairo buffer */
-    dest = surface_buf;
-    raw_image = gdk_pixbuf_get_pixels(pixbuf);
-    rowstride = gdk_pixbuf_get_rowstride(pixbuf);
-    if (n_chans == 4) {
-       /* 4 channels: copy 32-bit vals, converting R-G-B-Alpha to
-        * Alpha-R-G-B... */
-       gint line;
-
-       format = CAIRO_FORMAT_ARGB32;
-       for (line = 0; line < height; line++) {
-           guchar *src = raw_image + line * rowstride;
-           gint col;
-
-           for (col = width; col; col--, src += 4)
-               *dest++ = (((((src[3] << 8) + src[0]) << 8) + src[1]) << 8) + src[2];
-       }
-    } else {
-       /* 3 channels: copy 3 byte R-G-B to Alpha-R-G-B... */
-       gint line;
-
-       format = CAIRO_FORMAT_RGB24;
-       for (line = 0; line < height; line++) {
-           guchar *src = raw_image + line * rowstride;
-           gint col;
-
-           for (col = width; col; col--, src += 3)
-               *dest++ = (((src[0] << 8) + src[1]) << 8) + src[2];
-       }
-    }
 
     /* save current state */
     cairo_save(cairo_ctx);
 
-    /* create the curface */
-    surface =
-       cairo_image_surface_create_for_data((unsigned char *) surface_buf,
-                                           format, width, height,
-                                           4 * width);
-    cairo_set_source_surface(cairo_ctx, surface, c_at_x, c_at_y);
+    /* set the curface */
+    gdk_cairo_set_source_pixbuf(cairo_ctx, pixbuf, c_at_x, c_at_y);
 
     /* scale */
     pattern = cairo_get_source(cairo_ctx);
@@ -359,16 +314,14 @@ cairo_print_pixbuf(cairo_t * cairo_ctx, const GdkPixbuf * pixbuf,
     cairo_move_to(cairo_ctx, c_at_x, c_at_y);
     cairo_line_to(cairo_ctx, c_at_x + width * scale, c_at_y);
     cairo_line_to(cairo_ctx, c_at_x + width * scale,
-                 c_at_y + height * scale);
+                  c_at_y + height * scale);
     cairo_line_to(cairo_ctx, c_at_x, c_at_y + height * scale);
     cairo_close_path(cairo_ctx);
     cairo_clip(cairo_ctx);
 
-    /* paint, restore and clean up */
+    /* paint and restore */
     cairo_paint(cairo_ctx);
     cairo_restore(cairo_ctx);
-    cairo_surface_destroy(surface);
-    g_free(surface_buf);
 
     return TRUE;
 }
diff --git a/src/balsa-print-object.h b/src/balsa-print-object.h
index f43eda597..31b9475f1 100644
--- a/src/balsa-print-object.h
+++ b/src/balsa-print-object.h
@@ -71,7 +71,7 @@ typedef struct {
 
 gint p_string_width_from_layout(PangoLayout * layout, const gchar * text);
 gint p_string_height_from_layout(PangoLayout * layout, const gchar * text);
-gboolean cairo_print_pixbuf(cairo_t * cairo_ctx, const GdkPixbuf * pixbuf,
+gboolean cairo_print_pixbuf(cairo_t * cairo_ctx, GdkPixbuf * pixbuf,
                            gdouble c_at_x, gdouble c_at_y, gdouble scale);
 GList *split_for_layout(PangoLayout * layout, const gchar * text,
                        PangoAttrList * attributes,
diff --git a/src/print-gtk.c b/src/print-gtk.c
index 449d9db32..364ea9e30 100644
--- a/src/print-gtk.c
+++ b/src/print-gtk.c
@@ -5,14 +5,14 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
@@ -58,13 +58,13 @@ typedef struct {
 typedef struct {
     /* related message */
     LibBalsaMessage *message;
-    
+
     /* print setup */
     BalsaPrintSetup setup;
 
     /* print data */
     GList *print_parts;
- 
+
     /* header related stuff */
     gdouble c_header_y;
 
@@ -119,7 +119,7 @@ print_header_footer(GtkPrintContext * context, cairo_t * cairo_ctx,
 /*
  * Scan the parts of a multipart/alternative as to find the proper one for printing.  According to RFC 2046, 
Sect. 5.1.4, the first
  * /should/ be the "plain" one, and the following the "fancier" ones.  This is not guaranteed, though.
- * 
+ *
  * Furthermore, we may have cases like
  * +- multipart/alternative
  *      +- text/plain
@@ -386,13 +386,13 @@ begin_print(GtkPrintOperation * operation, GtkPrintContext * context,
 
     /* add the message headers */
     pdata->setup.c_y_pos = 0.0;        /* to simplify calculating the layout... */
-    pdata->print_parts = 
+    pdata->print_parts =
        balsa_print_object_header_from_message(NULL, context, pdata->message,
                                               subject, &pdata->setup);
     g_free(subject);
 
     /* add the mime bodies */
-    pdata->print_parts = 
+    pdata->print_parts =
        scan_body(pdata->print_parts, context, &pdata->setup,
                  libbalsa_message_get_body_list(pdata->message), FALSE);
 
@@ -447,36 +447,35 @@ get_default_user_units(void)
      * lengths to the user. Translate to default:inch if you
      * want inches, otherwise translate to default:mm.
      * Do *not* translate it to "predefinito:mm", if it
-     * it isn't default:mm or default:inch it will not work 
+     * it isn't default:mm or default:inch it will not work
      */
     gchar *e = _("default:mm");
-  
+
 #if HAVE__NL_MEASUREMENT_MEASUREMENT
     gchar *imperial = NULL;
-  
+
     imperial = nl_langinfo(_NL_MEASUREMENT_MEASUREMENT);
     if (imperial && imperial[0] == 2 )
        return GTK_UNIT_INCH;  /* imperial */
     if (imperial && imperial[0] == 1 )
        return GTK_UNIT_MM;  /* metric */
 #endif                          /* HAVE__NL_MEASUREMENT_MEASUREMENT */
-  
-    if (strcmp(e, "default:inch")==0)
+
+    if (strcmp(e, "default:inch") == 0)
        return GTK_UNIT_INCH;
-    else if (strcmp(e, "default:mm"))
+    else if (strcmp(e, "default:mm") != 0)
        g_warning("Whoever translated default:mm did so wrongly.");
     return GTK_UNIT_MM;
 }
 
 static GtkWidget *
-add_font_button(const gchar * text, const gchar * font, GtkGrid * grid,
-               gint row)
+add_font_button(const char * text, const char * font, GtkGrid * grid, int row)
 {
     GtkWidget *label;
     GtkWidget *font_button;
 
     label = gtk_label_new_with_mnemonic(text);
-    gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+    gtk_label_set_wrap(GTK_LABEL(label), TRUE);
     gtk_widget_set_halign(label, GTK_ALIGN_START);
     gtk_label_set_xalign(GTK_LABEL(label), 0.0F);
     gtk_grid_attach(grid, label, 1, row, 1, 1);
@@ -491,30 +490,27 @@ add_font_button(const gchar * text, const gchar * font, GtkGrid * grid,
 
 /* note: min and max are passed in points = 1/72" */
 static GtkWidget *
-add_margin_spinbtn(const gchar * text, gdouble min, gdouble max, gdouble dflt,
-                  GtkGrid * grid, gint row)
+add_margin_spinbtn(const char * text, double min, double max, double dflt, GtkGrid * grid, int row)
 {
     GtkWidget *label;
     GtkWidget *spinbtn;
-    const gchar *unit;
+    const char *unit;
 
     label = gtk_label_new_with_mnemonic(text);
-    gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+    gtk_label_set_wrap(GTK_LABEL(label), TRUE);
     gtk_widget_set_halign(label, GTK_ALIGN_START);
     gtk_label_set_xalign(GTK_LABEL(label), 0.0F);
     gtk_grid_attach(grid, label, 1, row, 1, 1);
 
     if (get_default_user_units() == GTK_UNIT_INCH) {
        unit = _("inch");
-       spinbtn = gtk_spin_button_new_with_range(min / 72.0,
-                                                max / 72.0, 0.01);
+       spinbtn = gtk_spin_button_new_with_range(min / 72.0, max / 72.0, 0.01);
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn), dflt / 72.0);
        gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spinbtn), 2);
        gtk_spin_button_set_increments(GTK_SPIN_BUTTON(spinbtn), 0.1, 1.0);
     } else {
        unit = _("mm");
-       spinbtn = gtk_spin_button_new_with_range(min / 72.0 * 25.4,
-                                                max / 72.0 * 25.4, 0.1);
+       spinbtn = gtk_spin_button_new_with_range(min / 72.0 * 25.4, max / 72.0 * 25.4, 0.1);
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn), dflt / 72.0 * 25.4);
        gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spinbtn), 1);
        gtk_spin_button_set_increments(GTK_SPIN_BUTTON(spinbtn), 1.0, 10.0);
@@ -544,10 +540,10 @@ check_margins(GtkAdjustment * adjustment, GtkAdjustment * other)
 static GtkWidget *
 create_options_group(const gchar *label_str, GtkWidget *parent_grid, gint parent_col, gint parent_row, gint 
parent_width)
 {
-       GtkWidget *group;
-       GtkWidget *label;
+    GtkWidget *group;
+    GtkWidget *label;
     GtkWidget *grid;
-    gchar *markup;
+    char *markup;
 
     group = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
     gtk_grid_attach(GTK_GRID(parent_grid), group, parent_col, parent_row, parent_width, 1);
@@ -555,14 +551,15 @@ create_options_group(const gchar *label_str, GtkWidget *parent_grid, gint parent
     markup = g_strdup_printf("<b>%s</b>", label_str);
     label = libbalsa_create_wrap_label(markup, TRUE);
     g_free(markup);
-    gtk_container_add(GTK_CONTAINER(group), label);
-
-       grid = gtk_grid_new();
-    gtk_container_add(GTK_CONTAINER(group), grid);
-       gtk_grid_set_column_spacing(GTK_GRID(grid), 0);
-       gtk_grid_set_row_spacing(GTK_GRID(grid), 6);
-       gtk_grid_attach(GTK_GRID(grid), gtk_label_new("    "), 0, 0, 1, 1);
-       return grid;
+    gtk_box_append(GTK_BOX(group), label);
+
+    grid = gtk_grid_new();
+    gtk_box_append(GTK_BOX(group), grid);
+    gtk_grid_set_column_spacing(GTK_GRID(grid), 0);
+    gtk_grid_set_row_spacing(GTK_GRID(grid), 6);
+    gtk_grid_attach(GTK_GRID(grid), gtk_label_new("    "), 0, 0, 1, 1);
+
+    return grid;
 }
 
 static GtkWidget *
@@ -581,14 +578,21 @@ message_prefs_widget(GtkPrintOperation * operation,
     page = gtk_grid_new();
     gtk_grid_set_column_spacing(GTK_GRID(page), 18);
     gtk_grid_set_row_spacing(GTK_GRID(page), 18);
-    gtk_container_set_border_width(GTK_CONTAINER(page), 12);
+
+    gtk_widget_set_margin_top(page, 12);
+    gtk_widget_set_margin_bottom(page, 12);
+    gtk_widget_set_margin_start(page, 12);
+    gtk_widget_set_margin_end(page, 12);
 
     /* fonts */
     grid = create_options_group(_("Fonts"), page, 0, 0, 3);
 
-    print_prefs->header_font = add_font_button(_("_Header Font:"), balsa_app.print_header_font, 
GTK_GRID(grid), 0);
-    print_prefs->body_font = add_font_button(_("B_ody Font:"), balsa_app.print_body_font, GTK_GRID(grid), 1);
-    print_prefs->footer_font = add_font_button(_("_Footer Font:"), balsa_app.print_footer_font, 
GTK_GRID(grid), 2);
+    print_prefs->header_font =
+        add_font_button(_("_Header Font:"), balsa_app.print_header_font, GTK_GRID(grid), 0);
+    print_prefs->body_font =
+        add_font_button(_("B_ody Font:"), balsa_app.print_body_font, GTK_GRID(grid), 1);
+    print_prefs->footer_font =
+        add_font_button(_("_Footer Font:"), balsa_app.print_footer_font, GTK_GRID(grid), 2);
 
     /* syntax highlighting */
     grid = create_options_group(_("Highlighting"), page, 0, 1, 1);
@@ -633,7 +637,7 @@ message_prefs_widget(GtkPrintOperation * operation,
     print_prefs->margin_bottom =
        add_margin_spinbtn(_("_Bottom"),
                           gtk_page_setup_get_bottom_margin(pg_setup, GTK_UNIT_POINTS),
-                          gtk_page_setup_get_page_height(pg_setup, GTK_UNIT_POINTS), 
+                          gtk_page_setup_get_page_height(pg_setup, GTK_UNIT_POINTS),
                           balsa_app.margin_bottom,
                           GTK_GRID(grid), 1);
     g_signal_connect(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(print_prefs->margin_top)),
@@ -645,13 +649,13 @@ message_prefs_widget(GtkPrintOperation * operation,
     print_prefs->margin_left =
        add_margin_spinbtn(_("_Left"),
                           gtk_page_setup_get_left_margin(pg_setup, GTK_UNIT_POINTS),
-                          gtk_page_setup_get_page_width(pg_setup, GTK_UNIT_POINTS), 
+                          gtk_page_setup_get_page_width(pg_setup, GTK_UNIT_POINTS),
                           balsa_app.margin_left,
                           GTK_GRID(grid), 2);
     print_prefs->margin_right =
        add_margin_spinbtn(_("_Right"),
                           gtk_page_setup_get_right_margin(pg_setup, GTK_UNIT_POINTS),
-                          gtk_page_setup_get_page_width(pg_setup, GTK_UNIT_POINTS), 
+                          gtk_page_setup_get_page_width(pg_setup, GTK_UNIT_POINTS),
                           balsa_app.margin_right,
                           GTK_GRID(grid), 3);
     g_signal_connect(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(print_prefs->margin_left)),
@@ -661,8 +665,6 @@ message_prefs_widget(GtkPrintOperation * operation,
                     "value-changed", G_CALLBACK(check_margins),
                     gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(print_prefs->margin_left)));
 
-    gtk_widget_show_all(page);
-
     return page;
 }
 


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