diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-week-view-main-item.c | 19 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 4 | ||||
-rw-r--r-- | calendar/gui/e-week-view.h | 1 |
3 files changed, 21 insertions, 3 deletions
diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index 007960c826..60d71f0631 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -295,7 +295,7 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, width - 5, line_y - y); } } - + /* Display the date in the top of the cell. In the week view, display the long format "10 January" in all cells, or abbreviate it to "10 Jan" or "10" if that doesn't fit. @@ -353,10 +353,23 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, date_x = x + width - date_width - E_WEEK_VIEW_DATE_R_PAD; date_x = MAX (date_x, x + 1); - if (selected) + if (selected) { gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED]); - else + } else if (week_view->multi_week_view) { + struct icaltimetype tt; + + /* Check if we are drawing today */ + tt = icaltime_from_timet_with_zone (time (NULL), FALSE, week_view->zone); + if (g_date_year (date) == tt.year + && g_date_month (date) == tt.month + && g_date_day (date) == tt.day) + gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_TODAY]); + else + gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]); + } else { gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]); + } + gdk_draw_string (drawable, font, gc, date_x, y + E_WEEK_VIEW_DATE_T_PAD + font->ascent, buffer); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index c9c4b4077e..7dd9d83cc3 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -593,6 +593,10 @@ e_week_view_realize (GtkWidget *widget) week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].green = 65535; week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].blue = 65535; + week_view->colors[E_WEEK_VIEW_COLOR_TODAY].red = 65535; + week_view->colors[E_WEEK_VIEW_COLOR_TODAY].green = 0; + week_view->colors[E_WEEK_VIEW_COLOR_TODAY].blue = 0; + nfailed = gdk_colormap_alloc_colors (colormap, week_view->colors, E_WEEK_VIEW_COLOR_LAST, FALSE, TRUE, success); diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h index e10954b9bd..ed14796414 100644 --- a/calendar/gui/e-week-view.h +++ b/calendar/gui/e-week-view.h @@ -106,6 +106,7 @@ typedef enum E_WEEK_VIEW_COLOR_SELECTED, E_WEEK_VIEW_COLOR_DATES, E_WEEK_VIEW_COLOR_DATES_SELECTED, + E_WEEK_VIEW_COLOR_TODAY, E_WEEK_VIEW_COLOR_LAST } EWeekViewColors; |