aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view-top-item.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-05-06 18:43:14 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-05-06 18:43:14 +0800
commit10ee8953e2d461f3164cbc32784af1ab887aa0c7 (patch)
treee4604f9a32f3e0b569e566216d4d2a969734a23d /calendar/gui/e-day-view-top-item.c
parent154973985a05b17e29e1588adccaee0c17dd11d5 (diff)
downloadgsoc2013-evolution-10ee8953e2d461f3164cbc32784af1ab887aa0c7.tar.gz
gsoc2013-evolution-10ee8953e2d461f3164cbc32784af1ab887aa0c7.tar.zst
gsoc2013-evolution-10ee8953e2d461f3164cbc32784af1ab887aa0c7.zip
added guint ref_count to iCalObject struct, and ical_object_ref/unref()
2000-05-06 Damon Chaplin <damon@helixcode.com> * cal-util/calobj.[hc]: added guint ref_count to iCalObject struct, and ical_object_ref/unref() functions. I've updated all the gui/ stuff to use ref_counts but I haven't touched the pcs/ stuff. Maybe just using ical_object_destroy() is OK there. * gui/gncal-todo.c: * gui/calendar-commands.c: * gui/eventedit.c: * gui/e-week-view.c: * gui/e-day-view.c: use refcounting for iCalObjects. * gui/e-day-view-main-item.c: * gui/e-day-view-top-item.c: * gui/e-day-view.c: try not to ever draw outside the event, even when the event is very small. 2000-05-05 Damon Chaplin <damon@helixcode.com> * gui/e-day-view.c: don't allow recurring events to be resized or dragged, and don't show the resize/drag cursors. Actually it may be better to let the user do the resize/drag and then ask them what they want to do - change the single occurrence or the entire series. * gui/e-day-view-time-item.c (e_day_view_time_item_show_popup_menu): use e_auto_kill_popup_menu_on_hide() to destroy the popup menu. * gui/popup-menu.c: include e-gui-utils.h svn path=/trunk/; revision=2823
Diffstat (limited to 'calendar/gui/e-day-view-top-item.c')
-rw-r--r--calendar/gui/e-day-view-top-item.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index ac2d6bfb62..8e084f4d42 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -330,8 +330,9 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
gint text_x, icon_x, icon_y, icon_x_inc;
iCalObject *ico;
gchar buffer[16];
- gint hour, minute, offset, time_width;
+ gint hour, minute, offset, time_width, time_x, min_end_time_x;
gboolean draw_start_triangle, draw_end_triangle;
+ GdkRectangle clip_rect;
day_view = dvtitem->day_view;
@@ -456,30 +457,50 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
/* Draw the start & end times, if necessary.
Note that GtkLabel adds 1 to the ascent so we must do that to be
level with it. */
+ min_end_time_x = item_x + E_DAY_VIEW_LONG_EVENT_X_PAD - x;
+
if (event->start > day_view->day_starts[start_day]) {
offset = day_view->first_hour_shown * 60
+ day_view->first_minute_shown + event->start_minute;
hour = offset / 60;
minute = offset % 60;
sprintf (buffer, "%02i:%02i", hour, minute);
+
+ clip_rect.x = item_x - x;
+ clip_rect.y = item_y - y;
+ clip_rect.width = item_w - E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH;
+ clip_rect.height = item_h;
+ gdk_gc_set_clip_rectangle (fg_gc, &clip_rect);
+
gdk_draw_string (drawable, font, fg_gc,
- item_x + + E_DAY_VIEW_LONG_EVENT_X_PAD - x,
+ item_x + E_DAY_VIEW_LONG_EVENT_X_PAD - x,
item_y + E_DAY_VIEW_LONG_EVENT_Y_PAD + font->ascent + 1 - y,
buffer);
+
+ gdk_gc_set_clip_rectangle (fg_gc, NULL);
+
+ min_end_time_x += day_view->small_hour_widths[hour] + 2
+ + day_view->max_minute_width + day_view->colon_width;
}
if (event->end < day_view->day_starts[end_day + 1]) {
offset = day_view->first_hour_shown * 60
- + day_view->first_minute_shown + event->end_minute;
+ + day_view->first_minute_shown
+ + event->end_minute;
hour = offset / 60;
minute = offset % 60;
- sprintf (buffer, "%02i:%02i", hour, minute);
time_width = day_view->small_hour_widths[hour]
+ day_view->max_minute_width + day_view->colon_width;
- gdk_draw_string (drawable, font, fg_gc,
- item_x + item_w - E_DAY_VIEW_LONG_EVENT_X_PAD - time_width - E_DAY_VIEW_LONG_EVENT_TIME_X_PAD - x,
- item_y + E_DAY_VIEW_LONG_EVENT_Y_PAD + font->ascent + 1 - y,
- buffer);
+ time_x = item_x + item_w - E_DAY_VIEW_LONG_EVENT_X_PAD - time_width - E_DAY_VIEW_LONG_EVENT_TIME_X_PAD - x;
+
+ if (time_x >= min_end_time_x) {
+ sprintf (buffer, "%02i:%02i", hour, minute);
+ gdk_draw_string (drawable, font, fg_gc,
+ time_x,
+ item_y + E_DAY_VIEW_LONG_EVENT_Y_PAD
+ + font->ascent + 1 - y,
+ buffer);
+ }
}
}