From a293afa0485e93c9eed50946a27c33c50fb27838 Mon Sep 17 00:00:00 2001 From: hiro Date: Wed, 6 Dec 2006 06:08:11 +0000 Subject: added page number on printing. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1395 ee746299-78ed-0310-b773-934348b2243d --- src/printing.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/printing.c') diff --git a/src/printing.c b/src/printing.c index cdfb74b8..bf0191ca 100644 --- a/src/printing.c +++ b/src/printing.c @@ -366,6 +366,16 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context, } g_print("count = %d\n", count); + desc = gtkut_get_default_font_desc(); + pango_font_description_set_size(desc, 12.0 * PANGO_SCALE); + pango_layout_set_font_description(layout, desc); + pango_font_description_free(desc); + g_snprintf(buf, sizeof(buf), "- %d -", pinfo->page_nr_per_msg + 1); + pango_layout_set_text(layout, buf, -1); + pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER); + cairo_move_to(cr, 0, height); + pango_cairo_show_layout(cr, layout); + g_object_unref(layout); } @@ -414,7 +424,7 @@ gint printing_print_messages_gtk(GSList *mlist, gboolean all_headers) } g_object_unref(op); - for (i = 0; i < print_data->n_pages; i++) { + for (i = 0; i < print_data->pages->len; i++) { PageInfo *pinfo; pinfo = g_ptr_array_index(print_data->pages, i); g_free(pinfo); -- cgit v1.2.3