aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view-time-item.c
diff options
context:
space:
mode:
authorThouis R. Jones <thouis@csail.mit.edu>2005-05-30 17:14:26 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2005-05-30 17:14:26 +0800
commit12390fa1e9b9b94f12840bfca5bb8cea9ca1df49 (patch)
treebba9438e18ca4527865416c3bc8799e717af94e7 /calendar/gui/e-day-view-time-item.c
parent4f64b1167ab2f51c5a534df8244954d0dbde287c (diff)
downloadgsoc2013-evolution-12390fa1e9b9b94f12840bfca5bb8cea9ca1df49.tar.gz
gsoc2013-evolution-12390fa1e9b9b94f12840bfca5bb8cea9ca1df49.tar.zst
gsoc2013-evolution-12390fa1e9b9b94f12840bfca5bb8cea9ca1df49.zip
Fixes #272301
2005-05-30 Thouis R. Jones <thouis@csail.mit.edu> Fixes #272301 * gui/apps_evolution_calendar.schemas.in.in: * gui/calendar-config-keys.h: * gui/calendar-config.c: (calendar_config_get_marcus_bains, calendar_config_add_notification_marcus_bains): * gui/calendar-config.h: * gui/e-day-view-config.c: (set_marcus_bains, marcus_bains_changed_cb, e_day_view_config_set_view): * gui/e-day-view-main-item.c: (e_day_view_main_item_draw): * gui/e-day-view-time-item.c: (e_day_view_time_item_draw): * gui/e-day-view.c: (e_day_view_init, e_day_view_set_colors, e_day_view_get_show_marcus_bains, e_day_view_set_marcus_bains, e_day_view_update_marcus_bains): * gui/e-day-view.h: * gui/gnome-cal.c: (update_marcus_bains_line_cb, setup_widgets, gnome_calendar_destroy): Added Marcus Bains Line to main item view and time bar. svn path=/trunk/; revision=29426
Diffstat (limited to 'calendar/gui/e-day-view-time-item.c')
-rw-r--r--calendar/gui/e-day-view-time-item.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c
index db4b66e54b..ae57439a10 100644
--- a/calendar/gui/e-day-view-time-item.c
+++ b/calendar/gui/e-day-view-time-item.c
@@ -40,6 +40,7 @@
#include <gal/widgets/e-gui-utils.h>
#include "e-day-view-time-item.h"
#include "calendar-config.h"
+#include <libecal/e-cal-time-util.h>
/* The spacing between items in the time column. GRID_X_PAD is the space down
@@ -252,7 +253,7 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item,
EDayView *day_view;
EDayViewTimeItem *dvtmitem;
GtkStyle *style;
- GdkGC *fg_gc, *dark_gc;
+ GdkGC *gc, *fg_gc, *dark_gc;
gchar buffer[64], *suffix;
gint hour, display_hour, minute, row;
gint row_y, start_y, large_hour_y_offset, small_font_y_offset;
@@ -278,6 +279,7 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item,
small_font_metrics = pango_context_get_metrics (context, small_font_desc,
pango_context_get_language (context));
+ gc = day_view->main_gc;
fg_gc = style->fg_gc[GTK_STATE_NORMAL];
dark_gc = style->dark_gc[GTK_STATE_NORMAL];
@@ -331,6 +333,30 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item,
pango_font_metrics_get_descent (large_font_metrics)) / PANGO_SCALE +
E_DVTMI_LARGE_HOUR_Y_PAD);
+ /* Draw the Marcus Bains Line first, so it appears under other elements. */
+ if (e_day_view_get_show_marcus_bains (day_view)) {
+ struct icaltimetype time_now;
+ int marcus_bains_y;
+ GdkColor mb_color;
+
+ gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]);
+
+ if (day_view->marcus_bains_time_bar_color && gdk_color_parse (day_view->marcus_bains_time_bar_color, &mb_color)) {
+ GdkColormap *colormap;
+
+ colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view));
+ if (gdk_colormap_alloc_color (colormap, &mb_color, TRUE, TRUE)) {
+ gdk_gc_set_foreground (gc, &mb_color);
+ }
+ }
+
+ time_now = icaltime_current_time_with_zone (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+ marcus_bains_y = (time_now.hour * 60 + time_now.minute) * day_view->row_height / day_view->mins_per_row - y;
+ gdk_draw_line (drawable, gc,
+ long_line_x1, marcus_bains_y,
+ long_line_x2, marcus_bains_y);
+ }
+
/* Step through each row, drawing the times and the horizontal lines
between them. */
for (row = 0, row_y = 0 - y;
@@ -614,7 +640,6 @@ e_day_view_time_item_on_button_release (EDayViewTimeItem *dvtmitem,
dvtmitem->dragging_selection = FALSE;
}
-
static void
e_day_view_time_item_on_motion_notify (EDayViewTimeItem *dvtmitem,
GdkEvent *event)