diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-07-01 22:47:10 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-07-01 22:47:10 +0800 |
commit | 1351c8e4fb443a9705bb1225c3c574c05a36f8ca (patch) | |
tree | e049bafefac361ae66dfa43abdb956f1f3a730e0 /calendar/gui | |
parent | 624f48121f523101fe26c3d3a8b51a4eeda90990 (diff) | |
parent | 42e75c9162402078ac629740821c3533925ee342 (diff) | |
download | gsoc2013-evolution-1351c8e4fb443a9705bb1225c3c574c05a36f8ca.tar.gz gsoc2013-evolution-1351c8e4fb443a9705bb1225c3c574c05a36f8ca.tar.zst gsoc2013-evolution-1351c8e4fb443a9705bb1225c3c574c05a36f8ca.zip |
Merge branch 'master' into kill-bonobo
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-day-view-main-item.c | 19 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 2 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 20 | ||||
-rw-r--r-- | calendar/gui/tag-calendar.c | 14 |
4 files changed, 37 insertions, 18 deletions
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index bcd1ca705e..a1ed7c0900 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -1074,8 +1074,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, e_cal_component_get_categories_list (comp, &categories_list); if (num_icons != 0) { - if (item_h >= (E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD) - * num_icons) { + if (item_h >= (E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD) * num_icons) { icon_x_inc = 0; icon_y_inc = E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD; @@ -1085,7 +1084,9 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_y_inc = 0; } - if (draw_reminder_icon) { + #define fit_in_event() icon_x + icon_x_inc < item_x + item_w && icon_y + icon_y_inc < item_y + item_h + + if (draw_reminder_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1104,7 +1105,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_y += icon_y_inc; } - if (draw_recurrence_icon) { + if (draw_recurrence_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1122,7 +1123,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_x += icon_x_inc; icon_y += icon_y_inc; } - if (draw_attach_icon) { + if (draw_attach_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1139,7 +1140,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_x += icon_x_inc; icon_y += icon_y_inc; } - if (draw_timezone_icon) { + if (draw_timezone_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1159,7 +1160,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, } - if (draw_meeting_icon) { + if (draw_meeting_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1175,7 +1176,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, } /* draw categories icons */ - for (elem = categories_list; elem; elem = elem->next) { + for (elem = categories_list; elem && fit_in_event (); elem = elem->next) { gchar *category; GdkPixmap *pixmap = NULL; GdkBitmap *mask = NULL; @@ -1208,6 +1209,8 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_y += icon_y_inc; } + #undef fit_in_event + gdk_gc_set_clip_mask (gc, NULL); } diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 802ddd8f8b..173fa054a6 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4687,8 +4687,6 @@ e_day_view_reshape_day_event (EDayView *day_view, if (num_icons > 0) { if (item_h >= (E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD) * num_icons) icons_offset = E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD * 2; - else - icons_offset = (E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD) * num_icons + E_DAY_VIEW_ICON_X_PAD; } if (!event->canvas_item) { diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index bcd30b0105..8fe302293f 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -546,7 +546,7 @@ gnome_calendar_get_current_view_widget (GnomeCalendar *gcal) } static void -get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_t *start_time, time_t *end_time) +get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_t *start_time, time_t *end_time, time_t *select_time) { GnomeCalendarPrivate *priv; gint shown, display_start; @@ -615,6 +615,9 @@ get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_ *start_time = icaltime_as_timet_with_zone (tt, priv->zone); *end_time = time_add_day_with_zone (*start_time, days_shown, priv->zone); + + if (select_time && E_DAY_VIEW (priv->views[view_type])->selection_start_day == -1) + time (select_time); break; case GNOME_CAL_WEEK_VIEW: /* FIXME We should be using the same day of the week enum every where */ @@ -622,6 +625,9 @@ get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_ *start_time = time_week_begin_with_zone (*start_time, display_start, priv->zone); *end_time = time_add_week_with_zone (*start_time, 1, priv->zone); + + if (select_time && E_WEEK_VIEW (priv->views[view_type])->selection_start_day == -1) + time (select_time); break; case GNOME_CAL_MONTH_VIEW: shown = e_week_view_get_weeks_shown (E_WEEK_VIEW (priv->views[view_type])); @@ -632,6 +638,9 @@ get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_ *start_time = time_month_begin_with_zone (*start_time, priv->zone); *start_time = time_week_begin_with_zone (*start_time, display_start, priv->zone); *end_time = time_add_week_with_zone (*start_time, shown, priv->zone); + + if (select_time && E_WEEK_VIEW (priv->views[view_type])->selection_start_day == -1) + time (select_time); break; case GNOME_CAL_LIST_VIEW: /* FIXME What to do here? */ @@ -843,7 +852,7 @@ set_search_query (GnomeCalendar *gcal, const gchar *sexp) e_cal_model_set_search_query_with_time_range (e_calendar_view_get_model (priv->views [i]), sexp, start, end); } else { start = priv->base_view_time; - get_times_for_views (gcal, GNOME_CAL_LIST_VIEW, &start, &end); + get_times_for_views (gcal, GNOME_CAL_LIST_VIEW, &start, &end, NULL); e_cal_model_set_search_query_with_time_range (e_calendar_view_get_model (priv->views [i]), sexp, start, end); @@ -1788,19 +1797,22 @@ update_view_times (GnomeCalendar *gcal, time_t start_time) GnomeCalendarPrivate *priv; ECalModel *model; time_t real_start_time = start_time; - time_t end_time; + time_t end_time, select_time = 0; priv = gcal->priv; priv->base_view_time = start_time; model = e_calendar_view_get_model (priv->views [priv->current_view_type]); - get_times_for_views (gcal, priv->current_view_type, &real_start_time, &end_time); + get_times_for_views (gcal, priv->current_view_type, &real_start_time, &end_time, &select_time); if (priv->current_view_type == GNOME_CAL_LIST_VIEW && !priv->lview_select_daten_range) return; e_cal_model_set_time_range (model, real_start_time, end_time); + + if (select_time != 0 && select_time >= real_start_time && select_time <= end_time) + e_calendar_view_set_selected_time_range (priv->views [priv->current_view_type], select_time, select_time); } static void diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c index 272d822a2c..2eddfbfec6 100644 --- a/calendar/gui/tag-calendar.c +++ b/calendar/gui/tag-calendar.c @@ -98,13 +98,18 @@ tag_calendar_cb (ECalComponent *comp, struct calendar_tag_closure *c = data; struct icaltimetype start_tt, end_tt; ECalComponentTransparency transparency; + guint8 style = 0; /* If we are skipping TRANSPARENT events, return if the event is transparent. */ - if (c->skip_transparent_events) { - e_cal_component_get_transparency (comp, &transparency); - if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT) + e_cal_component_get_transparency (comp, &transparency); + if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT) { + if (c->skip_transparent_events) return TRUE; + + style = E_CALENDAR_ITEM_MARK_ITALIC; + } else { + style = E_CALENDAR_ITEM_MARK_BOLD; } start_tt = icaltime_from_timet_with_zone (istart, FALSE, c->zone); @@ -114,7 +119,8 @@ tag_calendar_cb (ECalComponent *comp, start_tt.day, end_tt.year, end_tt.month - 1, end_tt.day, - E_CALENDAR_ITEM_MARK_BOLD); + style, + TRUE); return TRUE; } |