[gnome-calendar: 14/17] month-popover: sort events
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar: 14/17] month-popover: sort events
- Date: Wed, 15 Nov 2017 21:26:12 +0000 (UTC)
commit 09cd5d05cb0fd3411900ecdfe967a7990b8dc590
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Nov 15 03:17:04 2017 -0200
month-popover: sort events
src/views/gcal-month-popover.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/views/gcal-month-popover.c b/src/views/gcal-month-popover.c
index cf0e836..cdc103d 100644
--- a/src/views/gcal-month-popover.c
+++ b/src/views/gcal-month-popover.c
@@ -357,6 +357,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*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]