diff options
author | Thouis R. Jones <thouis@csail.mit.edu> | 2005-05-30 17:14:26 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2005-05-30 17:14:26 +0800 |
commit | 12390fa1e9b9b94f12840bfca5bb8cea9ca1df49 (patch) | |
tree | bba9438e18ca4527865416c3bc8799e717af94e7 /calendar/gui/e-day-view.c | |
parent | 4f64b1167ab2f51c5a534df8244954d0dbde287c (diff) | |
download | gsoc2013-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.c')
-rw-r--r-- | calendar/gui/e-day-view.c | 58 |
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) |