aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view-main-item.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-07-11 02:11:48 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-07-11 02:11:48 +0800
commit31fd01398cc76d3c00abbc05d419dfe873bc04c6 (patch)
tree35c238cdb2a8a68936fa659e5269e75ee0042b49 /calendar/gui/e-day-view-main-item.c
parentf9049cded460a9e316fa83ff1941970abfe0fd09 (diff)
parent10fef4ac0f4ef7dc907e8bfae9844d4e8be3d80d (diff)
downloadgsoc2013-evolution-31fd01398cc76d3c00abbc05d419dfe873bc04c6.tar.gz
gsoc2013-evolution-31fd01398cc76d3c00abbc05d419dfe873bc04c6.tar.zst
gsoc2013-evolution-31fd01398cc76d3c00abbc05d419dfe873bc04c6.zip
Merge branch 'master' into kill-bonobo
Conflicts: addressbook/util/addressbook.h calendar/gui/e-week-view-main-item.c configure.ac e-util/Makefile.am mail/em-account-editor.c mail/em-folder-selection-button.c shell/e-shell.c
Diffstat (limited to 'calendar/gui/e-day-view-main-item.c')
-rw-r--r--calendar/gui/e-day-view-main-item.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index a1ed7c0900..acbc192218 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -177,9 +177,10 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable,
gint work_day_start_y, work_day_end_y;
gint day_x, day_w, work_day;
gint start_row, end_row, rect_x, rect_y, rect_width, rect_height;
- struct icaltimetype day_start_tt;
+ struct icaltimetype day_start_tt, today_tt;
gint weekday;
cairo_t *cr;
+ gboolean today = FALSE;
cr = gdk_cairo_create (drawable);
@@ -199,6 +200,9 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable,
gc = day_view->main_gc;
work_day_end_y = e_day_view_convert_time_to_position (day_view, day_view->work_day_end_hour, day_view->work_day_end_minute) - y;
+ today_tt = icaltime_from_timet_with_zone (time (NULL), FALSE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+
for (day = 0; day < day_view->days_shown; day++) {
day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
@@ -218,8 +222,17 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable,
cairo_fill (cr);
cairo_restore (cr);
+ if (day_view->days_shown > 1) {
+ /* Check if we are drawing today */
+ today = day_start_tt.year == today_tt.year
+ && day_start_tt.month == today_tt.month
+ && day_start_tt.day == today_tt.day;
+ } else {
+ today = FALSE;
+ }
+
cairo_save (cr);
- gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING]);
+ gdk_cairo_set_source_color (cr, &day_view->colors[today ? E_DAY_VIEW_COLOR_BG_MULTIDAY_TODAY : E_DAY_VIEW_COLOR_BG_WORKING]);
cairo_rectangle (cr, day_x, work_day_start_y, day_w,
work_day_end_y - work_day_start_y);
@@ -613,12 +626,12 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem,
cairo_font_options_t *font_options;
guint16 red, green, blue;
gint i;
- gdouble radius, x0, y0, rect_height, rect_width;
+ gdouble radius, x0, y0, rect_height, rect_width, text_x_offset = 0.0;
gfloat alpha;
gboolean gradient;
gdouble cc = 65535.0;
gdouble date_fraction;
- gboolean short_event = FALSE, resize_flag = FALSE;
+ gboolean short_event = FALSE, resize_flag = FALSE, is_editing;
const gchar *end_resize_suffix;
gchar *end_regsizeime;
gint start_hour, start_display_hour, start_minute, start_suffix_width;
@@ -694,10 +707,13 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem,
}
}
+ is_editing = day_view->editing_event_day == day && day_view->editing_event_num == event_num;
+
+ if (event->canvas_item)
+ g_object_get (G_OBJECT (event->canvas_item), "x_offset", &text_x_offset, NULL);
+
/* Draw shadow around the event when selected */
- if (day_view->editing_event_day == day
- && day_view->editing_event_num == event_num && (GTK_WIDGET_HAS_FOCUS (day_view->main_canvas)))
- {
+ if (is_editing && (GTK_WIDGET_HAS_FOCUS (day_view->main_canvas))) {
/* For embossing Item selection */
item_x -= 1;
item_y -= 2;
@@ -892,8 +908,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem,
else
short_event = FALSE;
- if (day_view->editing_event_day == day
- && day_view->editing_event_num == event_num)
+ if (is_editing)
short_event = TRUE;
if (gradient) {
@@ -1034,7 +1049,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem,
&day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]);
/* Draw the reminder & recurrence icons, if needed. */
- if (!resize_flag) {
+ if (!resize_flag && (!is_editing || text_x_offset > E_DAY_VIEW_ICON_X_PAD)) {
num_icons = 0;
draw_reminder_icon = FALSE;
draw_recurrence_icon = FALSE;