aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gncal-full-day.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-09 02:42:58 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-09 02:42:58 +0800
commit56ccb475f967e535e6d7d4c5c77269156b9ec582 (patch)
tree3effdb64e008b4db386ef14a1c36470be02a923e /calendar/gncal-full-day.c
parent1e19f2f580e6b4ab54fd3ec038c30e0f9df8a7ad (diff)
downloadgsoc2013-evolution-56ccb475f967e535e6d7d4c5c77269156b9ec582.tar
gsoc2013-evolution-56ccb475f967e535e6d7d4c5c77269156b9ec582.tar.gz
gsoc2013-evolution-56ccb475f967e535e6d7d4c5c77269156b9ec582.tar.bz2
gsoc2013-evolution-56ccb475f967e535e6d7d4c5c77269156b9ec582.tar.lz
gsoc2013-evolution-56ccb475f967e535e6d7d4c5c77269156b9ec582.tar.xz
gsoc2013-evolution-56ccb475f967e535e6d7d4c5c77269156b9ec582.tar.zst
gsoc2013-evolution-56ccb475f967e535e6d7d4c5c77269156b9ec582.zip
Wheee! Now you can drag events correctly - Federico
svn path=/trunk/; revision=112
Diffstat (limited to 'calendar/gncal-full-day.c')
-rw-r--r--calendar/gncal-full-day.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/calendar/gncal-full-day.c b/calendar/gncal-full-day.c
index 067b119efa..10a8246f73 100644
--- a/calendar/gncal-full-day.c
+++ b/calendar/gncal-full-day.c
@@ -241,6 +241,22 @@ child_draw (GncalFullDay *fullday, Child *child, GdkRectangle *area, int draw_ch
}
static void
+child_range_changed (GncalFullDay *fullday, Child *child)
+{
+ struct tm start, end;
+ int lower_row, rows_used;
+ int f_lower_row;
+
+ /* Calc display range for event */
+
+ get_tm_range (fullday, child->ico->dtstart, child->ico->dtend, &start, &end, &lower_row, &rows_used);
+ get_tm_range (fullday, fullday->lower, fullday->upper, NULL, NULL, &f_lower_row, NULL);
+
+ child->lower_row = lower_row - f_lower_row;
+ child->rows_used = rows_used;
+}
+
+static void
child_realized_setup (GtkWidget *widget, gpointer data)
{
Child *child;
@@ -275,9 +291,6 @@ static Child *
child_new (GncalFullDay *fullday, iCalObject *ico)
{
Child *child;
- struct tm start, end;
- int lower_row, rows_used;
- int f_lower_row;
child = g_new (Child, 1);
@@ -289,13 +302,7 @@ child_new (GncalFullDay *fullday, iCalObject *ico)
child->width = 0;
child->height = 0;
- /* Calc display range for event */
-
- get_tm_range (fullday, child->ico->dtstart, child->ico->dtend, &start, &end, &lower_row, &rows_used);
- get_tm_range (fullday, fullday->lower, fullday->upper, NULL, NULL, &f_lower_row, NULL);
-
- child->lower_row = lower_row - f_lower_row;
- child->rows_used = rows_used;
+ child_range_changed (fullday, child);
/* We set the i-beam cursor and the initial summary text upon realization */
@@ -925,6 +932,8 @@ update_from_drag_info (GncalFullDay *fullday)
tm.tm_min += fullday->interval * used_rows;
di->child->ico->dtend = mktime (&tm);
+ child_range_changed (fullday, di->child);
+
/* FIXME: notify calendar of change */
/* FIXME: re-layout or let notification do it? */