[california] Ensure day-spanning events sort to top of Month cell: Bug #732224
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [california] Ensure day-spanning events sort to top of Month cell: Bug #732224
- Date: Wed, 25 Jun 2014 20:34:11 +0000 (UTC)
commit fd4d9b4a85ddf0d097a01dda97f9681e7dd675b6
Author: Jim Nelson <jim yorba org>
Date: Wed Jun 25 13:33:57 2014 -0700
Ensure day-spanning events sort to top of Month cell: Bug #732224
src/view/common/common-events-cell.vala | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/view/common/common-events-cell.vala b/src/view/common/common-events-cell.vala
index b25fe81..0e4ec52 100644
--- a/src/view/common/common-events-cell.vala
+++ b/src/view/common/common-events-cell.vala
@@ -149,9 +149,15 @@ internal abstract class EventsCell : Gtk.EventBox, InstanceContainer {
if (a == b)
return 0;
- if (!a.is_day_spanning && !b.is_day_spanning)
- return a.compare_to(b);
-
+ // * if neither are day spanning (i.e. all-day or timed that cross midnight) fall back on
+ // regular comparison
+ // * if one is day-spanning but not the other, day-spanning floats to the top
+ if (!a.is_day_spanning)
+ return !b.is_day_spanning ? a.compare_to(b) : 1;
+ else if (!b.is_day_spanning)
+ return -1;
+
+ // both are day-spanning use algorithm described above to prevent gaps
Calendar.DateSpan a_span = a.get_event_date_span(Calendar.Timezone.local);
Calendar.DateSpan b_span = b.get_event_date_span(Calendar.Timezone.local);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]