[gnome-calendar/wip/gbsneto/dnd] month-view: consider the days delay when dealing with the cell



commit 5960a45d005200554b5e86ff293450e2e07099e2
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat May 21 19:02:39 2016 -0300

    month-view: consider the days delay when dealing with the cell
    
    The cell number does not consider the days delay, thus is not
    the current day. To find the current day, we must remove the
    days delay.

 src/gcal-month-view.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index b200bee..f666d44 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -810,7 +810,7 @@ get_dnd_cell (GtkWidget *widget,
   cell = gather_button_event_data (GCAL_MONTH_VIEW (widget), x, y, NULL, NULL, NULL);
   cell = real_cell (cell, priv->k);
 
-  if (cell < g_date_get_days_in_month (priv->date->month, priv->date->year))
+  if (cell - priv->days_delay < g_date_get_days_in_month (priv->date->month, priv->date->year))
     return cell;
 
   return -1;
@@ -868,7 +868,7 @@ gcal_month_view_drag_drop (GtkWidget      *widget,
   start_dt = gcal_event_get_date_start (event);
   end_dt = gcal_event_get_date_end (event);
 
-  diff = cell - g_date_time_get_day_of_month (start_dt) + 1;
+  diff = cell - priv->days_delay - g_date_time_get_day_of_month (start_dt) + 1;
 
   if (diff != 0)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]