aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-10-09 14:59:54 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-10-09 14:59:54 +0800
commit537ec9575e3083df12cb07873b2b9d463e9b7ec9 (patch)
tree60ac9393556e8a6221c4bb68fc0a2105d2b2abb7 /calendar
parent4560333ccff61f2fdddf8d7eca8504ac1c2685dd (diff)
downloadgsoc2013-evolution-537ec9575e3083df12cb07873b2b9d463e9b7ec9.tar.gz
gsoc2013-evolution-537ec9575e3083df12cb07873b2b9d463e9b7ec9.tar.zst
gsoc2013-evolution-537ec9575e3083df12cb07873b2b9d463e9b7ec9.zip
** Fix for bug #324526
2007-10-09 Milan Crha <mcrha@redhat.com> ** Fix for bug #324526 * gui/print.c: (print_week_event): Draw picture with dots to indicate that not all events are printed in a day. svn path=/trunk/; revision=34364
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/print.c47
2 files changed, 54 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index be8d4dd67f..3ec4134432 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-09 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #324526
+
+ * gui/print.c: (print_week_event): Draw picture with dots to indicate
+ that not all events are printed in a day.
+
2007-10-07 Hiroyuki Ikezoe <poincare@ikezoe.net>
** Fix for bug #455862
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 41d002df79..2f18c8e244 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -56,6 +56,8 @@
#include <glade/glade-xml.h>
+#include "art/jump.xpm"
+
typedef struct PrintCompItem PrintCompItem;
typedef struct PrintCalItem PrintCalItem;
@@ -1392,6 +1394,7 @@ print_week_event (GtkPrintContext *context, PangoFontDescription *font,
int num_days, start_x, start_y, start_h, end_x, end_y, end_h;
double x1, x2, y1, y2;
double red, green, blue;
+ GdkPixbuf *pixbuf = NULL;
summary = icalcomponent_get_summary (event->comp_data->icalcomp);
text = summary ? (char*) summary : "";
@@ -1453,8 +1456,52 @@ print_week_event (GtkPrintContext *context, PangoFontDescription *font,
x1, x2, y1, y2,
event, span, text, red, green, blue);
}
+ } else {
+ cairo_t *cr = gtk_print_context_get_cairo_context (context);
+
+ e_week_view_layout_get_day_position
+ (span->start_day,
+ psi->multi_week_view,
+ psi->weeks_shown,
+ psi->display_start_weekday,
+ psi->compress_weekend,
+ &start_x, &start_y, &start_h);
+
+ x1 = left + (start_x + 1) * cell_width - 16;
+ y1 = top + start_y * cell_height
+ + psi->header_row_height
+ + psi->rows_per_cell * psi->row_height;
+
+ if (span->row >= psi->rows_per_compressed_cell && psi->compress_weekend) {
+ gint end_day_of_week = (psi->display_start_weekday + span->start_day) % 7;
+
+ if (end_day_of_week == 5 || end_day_of_week == 6) {
+ /* Sat or Sun */
+ y1 = y1 + (psi->rows_per_compressed_cell - psi->rows_per_cell) * psi->row_height - 3.0;
+ }
+ }
+
+ if (!pixbuf) {
+ const char **xpm = (const char **)jump_xpm;
+
+ /* this ugly thing is here only to get rid of compiler warning
+ about unused 'jump_xpm_focused' */
+ if (pixbuf)
+ xpm = (const char **)jump_xpm_focused;
+
+ pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
+ }
+
+ cairo_save (cr);
+ cairo_scale (cr, 0.5, 0.5);
+ gdk_cairo_set_source_pixbuf (cr, pixbuf, x1 * 2.0, y1 * 2.0);
+ cairo_paint (cr);
+ cairo_restore (cr);
}
}
+
+ if (pixbuf)
+ g_object_unref (pixbuf);
}