aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view-titles-item.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-11-27 07:33:07 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-11-27 07:33:07 +0800
commita01422975f3b39905bb09ef6d40aedb4c7ba9446 (patch)
tree867a98600c9962cb6f7356e9af03125b6f8ac9fe /calendar/gui/e-week-view-titles-item.c
parent30bb3527694d38c84f6f3c3efc1cdca5777da855 (diff)
downloadgsoc2013-evolution-a01422975f3b39905bb09ef6d40aedb4c7ba9446.tar.gz
gsoc2013-evolution-a01422975f3b39905bb09ef6d40aedb4c7ba9446.tar.zst
gsoc2013-evolution-a01422975f3b39905bb09ef6d40aedb4c7ba9446.zip
added more support for config settings.
2000-11-26 Damon Chaplin <damon@helixcode.com> * gui/gnome-cal.c: added more support for config settings. * gui/e-week-view.[hc]: * gui/e-day-view.[hc]: added support for setting - show event end times, week start day and 12-hour format (unfinished). * gui/e-day-view-time-item.c: started 12-hour support. * gui/tag-calendar.c (prepare_tag): use end_day + 1 since we want to include the last day. * gui/event-editor.c (set_all_day): minor change when turning all_day off - set the event end to one hour after the event start if it is on or before the start time. Also added more comments to make it a bit clearer. * cal-util/cal-recur.c (cal_obj_time_add_days): use a gint for day rather than a guint since we now support -ve days. Also fixed bug with weekly recurrences. * gui/dialogs/task-editor.c (task_editor_create_date_edit): use config settings. * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_update_config): updated EDateEdit calls. svn path=/trunk/; revision=6675
Diffstat (limited to 'calendar/gui/e-week-view-titles-item.c')
-rw-r--r--calendar/gui/e-week-view-titles-item.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c
index 14f47e4bcf..5a2b9c164a 100644
--- a/calendar/gui/e-week-view-titles-item.c
+++ b/calendar/gui/e-week-view-titles-item.c
@@ -174,6 +174,7 @@ e_week_view_titles_item_draw (GnomeCanvasItem *canvas_item,
GDate date;
GdkRectangle clip_rect;
gboolean long_format;
+ gint weekday;
#if 0
g_print ("In e_week_view_titles_item_draw %i,%i %ix%i\n",
@@ -222,9 +223,12 @@ e_week_view_titles_item_draw (GnomeCanvasItem *canvas_item,
/* Draw the date. Set a clipping rectangle so we don't draw over the
next day. */
g_date_clear (&date, 1);
- g_date_set_dmy (&date, 27, 3, 2000); /* Must be a Monday. */
+ /* Note that 20th March 2000 is a Monday. We only care about the
+ weekday. */
+ weekday = week_view->display_start_day;
+ g_date_set_dmy (&date, 20 + weekday, 3, 2000);
for (col = 0; col < week_view->columns; col++) {
- if (col == 5 && week_view->compress_weekend) {
+ if (weekday == 5 && week_view->compress_weekend) {
g_date_strftime (buffer, 128, "%a/", &date);
g_date_add_days (&date, 1);
g_date_strftime (buffer + strlen (buffer), 100,
@@ -239,14 +243,14 @@ e_week_view_titles_item_draw (GnomeCanvasItem *canvas_item,
clip_rect.height = canvas_height - 2;
gdk_gc_set_clip_rectangle (fg_gc, &clip_rect);
- if (col == 5 && week_view->compress_weekend)
+ if (weekday == 5 && week_view->compress_weekend)
date_width = week_view->abbr_day_widths[5]
+ week_view->slash_width
+ week_view->abbr_day_widths[6];
else if (long_format)
- date_width = week_view->day_widths[col];
+ date_width = week_view->day_widths[weekday];
else
- date_width = week_view->abbr_day_widths[col];
+ date_width = week_view->abbr_day_widths[weekday];
date_x = week_view->col_offsets[col]
+ (week_view->col_widths[col] - date_width) / 2;
@@ -280,6 +284,13 @@ e_week_view_titles_item_draw (GnomeCanvasItem *canvas_item,
canvas_height - y);
}
+ if (weekday == 5 && week_view->compress_weekend)
+ weekday += 2;
+ else
+ weekday++;
+
+ weekday = weekday % 7;
+
g_date_add_days (&date, 1);
}
}