diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index a090cbeb..50e23c3c 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -73,6 +73,8 @@ typedef struct /* text direction factors */ gint k; + icaltimetype *current_date; + /* property */ icaltimetype *date; } GcalMonthViewPrivate; @@ -1214,7 +1216,8 @@ gcal_month_view_draw (GtkWidget *widget, g_object_unref (overflow_layout); } - if (priv->date->day == j) + if (priv->date->year == priv->current_date->year && priv->date->month == priv->current_date->month && + j == priv->current_date->day) { PangoLayout *clayout; PangoFontDescription *cfont_desc; @@ -1704,6 +1707,16 @@ gcal_month_view_new (void) return g_object_new (GCAL_TYPE_MONTH_VIEW, NULL); } +void +gcal_month_view_set_current_date (GcalMonthView *month_view, + icaltimetype *current_date) +{ + GcalMonthViewPrivate *priv = gcal_month_view_get_instance_private (month_view); + + priv->current_date = current_date; + gtk_widget_queue_draw (GTK_WIDGET (month_view)); +} + /** * gcal_month_view_set_first_weekday: * @view: A #GcalMonthView instance diff --git a/src/gcal-month-view.h b/src/gcal-month-view.h index 2903d5fb..9b615d7e 100644 --- a/src/gcal-month-view.h +++ b/src/gcal-month-view.h @@ -47,6 +47,8 @@ struct _GcalMonthViewClass GType gcal_month_view_get_type (void); GtkWidget* gcal_month_view_new (void); +void gcal_month_view_set_current_date (GcalMonthView *month_view, + icaltimetype *current_date); void gcal_month_view_set_first_weekday (GcalMonthView *view, gint day_nr); void gcal_month_view_set_use_24h_format (GcalMonthView *view, diff --git a/src/gcal-window.c b/src/gcal-window.c index f688ecb8..8a922f7c 100644 --- a/src/gcal-window.c +++ b/src/gcal-window.c @@ -333,6 +333,7 @@ update_current_date (GcalWindow *window) *(priv->current_date) = icaltime_current_time_with_zone (gcal_manager_get_system_timezone (priv->manager)); *(priv->current_date) = icaltime_set_timezone (priv->current_date, gcal_manager_get_system_timezone (priv->manager)); + gcal_month_view_set_current_date (GCAL_MONTH_VIEW (priv->month_view), priv->current_date); gcal_year_view_set_current_date (GCAL_YEAR_VIEW (priv->year_view), priv->current_date); seconds = 24 * 60 * 60 - (icaltime_as_timet (*(priv->current_date)) % (24 * 60 * 60));