gcal-view: modified API
Implemented in views. Reworked GcalDayView implementation to allow bigger than days events.
This commit is contained in:
+13
-9
@@ -149,8 +149,9 @@ static icaltimetype* gcal_week_view_get_initial_date (GcalView *view
|
||||
|
||||
static icaltimetype* gcal_week_view_get_final_date (GcalView *view);
|
||||
|
||||
static gboolean gcal_week_view_contains_date (GcalView *view,
|
||||
icaltimetype *date);
|
||||
static gboolean gcal_week_view_draw_event (GcalView *view,
|
||||
icaltimetype *start_date,
|
||||
icaltimetype *end_date);
|
||||
|
||||
static GtkWidget* gcal_week_view_get_by_uuid (GcalView *view,
|
||||
const gchar *uuid);
|
||||
@@ -233,7 +234,8 @@ gcal_view_interface_init (GcalViewIface *iface)
|
||||
{
|
||||
iface->get_initial_date = gcal_week_view_get_initial_date;
|
||||
iface->get_final_date = gcal_week_view_get_final_date;
|
||||
iface->contains_date = gcal_week_view_contains_date;
|
||||
|
||||
iface->draw_event = gcal_week_view_draw_event;
|
||||
|
||||
iface->get_by_uuid = gcal_week_view_get_by_uuid;
|
||||
}
|
||||
@@ -975,7 +977,7 @@ gcal_week_view_set_date (GcalWeekView *view,
|
||||
will_resize = FALSE;
|
||||
|
||||
/* if span_updated: queue_resize */
|
||||
will_resize = ! gcal_week_view_contains_date (GCAL_VIEW (view), date);
|
||||
will_resize = ! gcal_week_view_draw_event (GCAL_VIEW (view), date, NULL);
|
||||
|
||||
if (priv->date != NULL)
|
||||
g_free (priv->date);
|
||||
@@ -995,7 +997,7 @@ gcal_week_view_set_date (GcalWeekView *view,
|
||||
|
||||
child = (GcalWeekViewChild*) l->data;
|
||||
child_date = gcal_event_widget_get_date (GCAL_EVENT_WIDGET (child->widget));
|
||||
if (! gcal_week_view_contains_date (GCAL_VIEW (view), child_date))
|
||||
if (! gcal_week_view_draw_event (GCAL_VIEW (view), child_date, NULL))
|
||||
to_remove = g_list_append (to_remove, child->widget);
|
||||
}
|
||||
}
|
||||
@@ -1498,8 +1500,9 @@ gcal_week_view_get_final_date (GcalView *view)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gcal_week_view_contains_date (GcalView *view,
|
||||
icaltimetype *date)
|
||||
gcal_week_view_draw_event (GcalView *view,
|
||||
icaltimetype *start_date,
|
||||
icaltimetype *end_date)
|
||||
{
|
||||
GcalWeekViewPrivate *priv;
|
||||
|
||||
@@ -1508,8 +1511,9 @@ gcal_week_view_contains_date (GcalView *view,
|
||||
|
||||
if (priv->date == NULL)
|
||||
return FALSE;
|
||||
if (icaltime_week_number (*(priv->date)) == icaltime_week_number (*date)
|
||||
&& priv->date->year == date->year)
|
||||
|
||||
if (icaltime_week_number (*(priv->date)) == icaltime_week_number (*start_date)
|
||||
&& priv->date->year == start_date->year)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user