aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2006-01-13 17:12:59 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-01-13 17:12:59 +0800
commit1e2901cd509edbbe74b5effd5c44a7570100ca85 (patch)
treede147a7643c3527f5253a78b610318b11004d722 /calendar/gui
parentbc8ab923cec3f385e3641dc19278d2ce288d41a7 (diff)
downloadgsoc2013-evolution-1e2901cd509edbbe74b5effd5c44a7570100ca85.tar.gz
gsoc2013-evolution-1e2901cd509edbbe74b5effd5c44a7570100ca85.tar.zst
gsoc2013-evolution-1e2901cd509edbbe74b5effd5c44a7570100ca85.zip
** Fixes bug #274234
2006-01-13 Srinivasa Ragavan <sragavan@novell.com> ** Fixes bug #274234 * gui/e-week-view-main-item.c: (e_week_view_main_item_draw_day): Bolds the date if drawing Today. * gui/gnome-cal.c (gnome_calendar_goto) (gnome_calendar_on_date_navigator_selection_changed): Call the parent views to update the selection. svn path=/trunk/; revision=31158
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-week-view-main-item.c18
-rw-r--r--calendar/gui/gnome-cal.c15
2 files changed, 26 insertions, 7 deletions
diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c
index e33ec66e3f..06669b5ecb 100644
--- a/calendar/gui/e-week-view-main-item.c
+++ b/calendar/gui/e-week-view-main-item.c
@@ -210,6 +210,7 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
PangoContext *pango_context;
PangoFontMetrics *font_metrics;
PangoLayout *layout;
+ gboolean today = FALSE;
#if 0
g_print ("Drawing Day:%i at %i,%i\n", day, x, y);
@@ -345,18 +346,27 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
if (g_date_year (date) == tt.year
&& g_date_month (date) == tt.month
- && g_date_day (date) == tt.day)
+ && g_date_day (date) == tt.day) {
gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_TODAY]);
+ today = TRUE;
+ }
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]);
}
- g_date_strftime (buffer, sizeof (buffer),
- format_string ? format_string : "%d", date);
+ if (today) {
+ g_date_strftime (buffer, sizeof (buffer),
+ format_string ? format_string : "<b>%d</b>", date);
+ layout = gtk_widget_create_pango_layout (GTK_WIDGET (week_view), buffer);
+ pango_layout_set_markup (layout, buffer, strlen(buffer));
+ } else {
+ g_date_strftime (buffer, sizeof (buffer),
+ format_string ? format_string : "%d", date);
+ layout = gtk_widget_create_pango_layout (GTK_WIDGET (week_view), buffer);
+ }
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (week_view), buffer);
pango_layout_get_pixel_size (layout, &date_width, NULL);
date_x = x + width - date_width - E_WEEK_VIEW_DATE_R_PAD;
date_x = MAX (date_x, x + 1);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index f3612e4c41..cc46a97b2a 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -1774,7 +1774,8 @@ void
gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time)
{
GnomeCalendarPrivate *priv;
-
+ int i;
+
g_return_if_fail (gcal != NULL);
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
g_return_if_fail (new_time != -1);
@@ -1784,6 +1785,11 @@ gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time)
update_view_times (gcal, new_time);
gnome_calendar_update_date_navigator (gcal);
gnome_calendar_notify_dates_shown_changed (gcal);
+
+ for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) {
+ if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (priv->views[i]))->set_selected_time_range)
+ E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (priv->views[i]))->set_selected_time_range (priv->views[i], new_time, new_time);
+ }
}
@@ -3115,9 +3121,12 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem, Gnom
/* FIXME Gross hack so that the view times are updated properly */
priv->range_selected = TRUE;
- e_week_view_set_weeks_shown (E_WEEK_VIEW (priv->month_view),
+ if (priv->current_view_type == GNOME_CAL_MONTH_VIEW) {
+ e_week_view_set_weeks_shown (E_WEEK_VIEW (priv->month_view),
(new_days_shown + 6) / 7);
- view_type = GNOME_CAL_MONTH_VIEW;
+ view_type = GNOME_CAL_MONTH_VIEW;
+ } else
+ view_type = GNOME_CAL_LIST_VIEW;
} else if (new_days_shown == 7 && starts_on_week_start_day) {
view_type = GNOME_CAL_WEEK_VIEW;
} else {