aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view-main-item.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2002-01-15 04:21:20 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-01-15 04:21:20 +0800
commitbde55a8d92780b10706dd0d942eab532fcb2ba91 (patch)
tree496b4a2057c6bbc1e855fae834ecf7109646a765 /calendar/gui/e-week-view-main-item.c
parentd54a3c91c587f2d481c8c52b1674210502acbe85 (diff)
downloadgsoc2013-evolution-bde55a8d92780b10706dd0d942eab532fcb2ba91.tar
gsoc2013-evolution-bde55a8d92780b10706dd0d942eab532fcb2ba91.tar.gz
gsoc2013-evolution-bde55a8d92780b10706dd0d942eab532fcb2ba91.tar.bz2
gsoc2013-evolution-bde55a8d92780b10706dd0d942eab532fcb2ba91.tar.lz
gsoc2013-evolution-bde55a8d92780b10706dd0d942eab532fcb2ba91.tar.xz
gsoc2013-evolution-bde55a8d92780b10706dd0d942eab532fcb2ba91.tar.zst
gsoc2013-evolution-bde55a8d92780b10706dd0d942eab532fcb2ba91.zip
figure out when today is and highlight if it is not selected
2002-01-14 JP Rosevear <jpr@ximian.com> * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day): figure out when today is and highlight if it is not selected * gui/e-week-view.h: enum the "today" color * gui/e-week-view.c (e_week_view_realize): init the "today" color svn path=/trunk/; revision=15319
Diffstat (limited to 'calendar/gui/e-week-view-main-item.c')
-rw-r--r--calendar/gui/e-week-view-main-item.c19
1 files changed, 16 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);