From a37157808d52f4e2cf12db792f0ad3105c02d507 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 1 May 2002 16:56:05 +0000 Subject: modify the start and end hours to accomodate all the events in the day 2002-05-01 JP Rosevear * gui/print.c (print_day_details): modify the start and end hours to accomodate all the events in the day * gui/e-day-view.c (free_view_popup): only discard the popup if we created one svn path=/trunk/; revision=16655 --- calendar/gui/print.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'calendar/gui/print.c') diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 6e385a065d..b353fc24fb 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -1132,6 +1132,29 @@ print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence, qsort (pdi.events[0]->data, pdi.events[0]->len, sizeof (EDayViewEvent), e_day_view_event_sort_func); + /* Also print events outside of work hours */ + if (pdi.events[0]->len > 0) { + icaltimezone *zone = get_timezone (); + struct icaltimetype tt; + + event = &g_array_index (pdi.events[0], EDayViewEvent, 0); + tt = icaltime_from_timet_with_zone (event->start, FALSE, zone); + if (tt.hour < pdi.start_hour) + pdi.start_hour = tt.hour; + pdi.start_minute_offset = pdi.start_hour * 60; + + event = &g_array_index (pdi.events[0], EDayViewEvent, pdi.events[0]->len - 1); + tt = icaltime_from_timet_with_zone (event->end, FALSE, zone); + if (tt.hour > pdi.end_hour || tt.hour == 0) { + pdi.end_hour = tt.hour ? tt.hour : 24; + if (tt.minute > 0) + pdi.end_hour++; + } + pdi.end_minute_offset = pdi.end_hour * 60; + + pdi.rows = (pdi.end_hour - pdi.start_hour) * 2; + } + /* Lay them out the long events, across the top of the page. */ e_day_view_layout_long_events (pdi.long_events, pdi.days_shown, pdi.day_starts, &rows_in_top_display); -- cgit v1.2.3