month-popover: sort events

This commit is contained in:
Georges Basile Stavracas Neto
2017-11-15 03:17:04 -02:00
parent 72b9b34235
commit 09cd5d05cb
+21
View File
@@ -356,6 +356,25 @@ update_event_list (GcalMonthPopover *self)
}
/*
* GtkListBox functions
*/
static gint
sort_func (GtkListBoxRow *a,
GtkListBoxRow *b,
gpointer user_data)
{
GcalEventWidget *event_a;
GcalEventWidget *event_b;
event_a = GCAL_EVENT_WIDGET (gtk_bin_get_child (GTK_BIN (a)));
event_b = GCAL_EVENT_WIDGET (gtk_bin_get_child (GTK_BIN (b)));
return gcal_event_widget_sort_events (event_a, event_b);
}
/*
* Callbacks
*/
@@ -718,6 +737,8 @@ gcal_month_popover_init (GcalMonthPopover *self)
G_CALLBACK (revealer_notify_child_revealed_cb),
self,
G_CONNECT_SWAPPED);
gtk_list_box_set_sort_func (GTK_LIST_BOX (self->listbox), sort_func, NULL, NULL);
}
GtkWidget*