aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorThouis R. Jones <thouis@csail.mit.edu>2005-05-13 19:08:28 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2005-05-13 19:08:28 +0800
commit51490d54078a67793ab48584a4f672d0ae3d3bd4 (patch)
treeb448ad9371d92e8edbe0126f60cdf01cb77571a5 /calendar/gui/e-day-view.c
parent8b3b58503dca17206fd530fc4828fdd51faa08a3 (diff)
downloadgsoc2013-evolution-51490d54078a67793ab48584a4f672d0ae3d3bd4.tar.gz
gsoc2013-evolution-51490d54078a67793ab48584a4f672d0ae3d3bd4.tar.zst
gsoc2013-evolution-51490d54078a67793ab48584a4f672d0ae3d3bd4.zip
Fixes #272301
2005-05-13 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=29351
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index e7c924fb01..1bee23f573 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -716,6 +716,10 @@ e_day_view_init (EDayView *day_view)
day_view->week_start_day = 0;
day_view->scroll_to_work_day = TRUE;
+ day_view->show_marcus_bains_line = TRUE;
+ day_view->marcus_bains_day_view_color = NULL;
+ day_view->marcus_bains_time_bar_color = NULL;
+
day_view->editing_event_day = -1;
day_view->editing_event_num = -1;
@@ -1161,6 +1165,7 @@ e_day_view_set_colors(EDayView *day_view, GtkWidget *widget)
day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER] = widget->style->dark[GTK_STATE_NORMAL];
day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND] = widget->style->bg[GTK_STATE_ACTIVE];
day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER] = widget->style->dark[GTK_STATE_NORMAL];
+ day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE] = widget->style->dark[GTK_STATE_PRELIGHT];
}
static void
@@ -2468,6 +2473,59 @@ e_day_view_set_working_day (EDayView *day_view,
gtk_widget_queue_draw (day_view->main_canvas);
}
+
+/* Whether we display the Marcus Bains Line in the main canvas and time canvas. */
+gboolean
+e_day_view_get_show_marcus_bains (EDayView *day_view)
+{
+ g_return_val_if_fail (E_IS_DAY_VIEW (day_view), TRUE);
+ return day_view->show_marcus_bains_line;
+}
+
+/* Force a redraw of the Marcus Bains Lines */
+void
+e_day_view_update_marcus_bains (EDayView *day_view)
+{
+ g_return_if_fail (E_IS_DAY_VIEW (day_view));
+ gtk_widget_queue_draw (day_view->main_canvas);
+ gtk_widget_queue_draw (day_view->time_canvas);
+}
+
+
+/* Update the variables controlling the Marcus Bains Line (display toggle, and colors). */
+void
+e_day_view_set_marcus_bains (EDayView *day_view,
+ gboolean show_line,
+ const char *dayview_color,
+ const char *timebar_color)
+{
+ g_return_if_fail (E_IS_DAY_VIEW (day_view));
+
+ if ((day_view->show_marcus_bains_line != show_line) |
+ (day_view->marcus_bains_day_view_color != dayview_color) |
+ (day_view->marcus_bains_time_bar_color != timebar_color)) {
+
+ if (day_view->marcus_bains_day_view_color)
+ g_free (day_view->marcus_bains_day_view_color);
+ if (day_view->marcus_bains_time_bar_color)
+ g_free (day_view->marcus_bains_time_bar_color);
+
+ day_view->show_marcus_bains_line = show_line;
+ if (dayview_color)
+ day_view->marcus_bains_day_view_color = g_strdup (dayview_color);
+ else
+ day_view->marcus_bains_day_view_color = NULL;
+
+ if (timebar_color)
+ day_view->marcus_bains_time_bar_color = g_strdup (timebar_color);
+ else
+ day_view->marcus_bains_time_bar_color = NULL;
+
+ e_day_view_update_marcus_bains (day_view);
+ }
+}
+
+
/* Whether we display event end times in the main canvas. */
gboolean
e_day_view_get_show_event_end_times (EDayView *day_view)