month-view: highlight current date properly

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=703323
This commit is contained in:
Erick Pérez Castellanos
2015-01-28 15:54:16 -05:00
parent 86d5a23ddd
commit 88e95081c5
3 changed files with 17 additions and 1 deletions
+14 -1
View File
@@ -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