Wheee! Now you can drag events correctly - Federico
svn path=/trunk/; revision=112
This commit is contained in:
@ -240,6 +240,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
|
static void
|
||||||
child_realized_setup (GtkWidget *widget, gpointer data)
|
child_realized_setup (GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
@ -275,9 +291,6 @@ static Child *
|
|||||||
child_new (GncalFullDay *fullday, iCalObject *ico)
|
child_new (GncalFullDay *fullday, iCalObject *ico)
|
||||||
{
|
{
|
||||||
Child *child;
|
Child *child;
|
||||||
struct tm start, end;
|
|
||||||
int lower_row, rows_used;
|
|
||||||
int f_lower_row;
|
|
||||||
|
|
||||||
child = g_new (Child, 1);
|
child = g_new (Child, 1);
|
||||||
|
|
||||||
@ -289,13 +302,7 @@ child_new (GncalFullDay *fullday, iCalObject *ico)
|
|||||||
child->width = 0;
|
child->width = 0;
|
||||||
child->height = 0;
|
child->height = 0;
|
||||||
|
|
||||||
/* Calc display range for event */
|
child_range_changed (fullday, child);
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
/* We set the i-beam cursor and the initial summary text upon realization */
|
/* 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;
|
tm.tm_min += fullday->interval * used_rows;
|
||||||
di->child->ico->dtend = mktime (&tm);
|
di->child->ico->dtend = mktime (&tm);
|
||||||
|
|
||||||
|
child_range_changed (fullday, di->child);
|
||||||
|
|
||||||
/* FIXME: notify calendar of change */
|
/* FIXME: notify calendar of change */
|
||||||
|
|
||||||
/* FIXME: re-layout or let notification do it? */
|
/* FIXME: re-layout or let notification do it? */
|
||||||
|
@ -240,6 +240,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
|
static void
|
||||||
child_realized_setup (GtkWidget *widget, gpointer data)
|
child_realized_setup (GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
@ -275,9 +291,6 @@ static Child *
|
|||||||
child_new (GncalFullDay *fullday, iCalObject *ico)
|
child_new (GncalFullDay *fullday, iCalObject *ico)
|
||||||
{
|
{
|
||||||
Child *child;
|
Child *child;
|
||||||
struct tm start, end;
|
|
||||||
int lower_row, rows_used;
|
|
||||||
int f_lower_row;
|
|
||||||
|
|
||||||
child = g_new (Child, 1);
|
child = g_new (Child, 1);
|
||||||
|
|
||||||
@ -289,13 +302,7 @@ child_new (GncalFullDay *fullday, iCalObject *ico)
|
|||||||
child->width = 0;
|
child->width = 0;
|
||||||
child->height = 0;
|
child->height = 0;
|
||||||
|
|
||||||
/* Calc display range for event */
|
child_range_changed (fullday, child);
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
/* We set the i-beam cursor and the initial summary text upon realization */
|
/* 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;
|
tm.tm_min += fullday->interval * used_rows;
|
||||||
di->child->ico->dtend = mktime (&tm);
|
di->child->ico->dtend = mktime (&tm);
|
||||||
|
|
||||||
|
child_range_changed (fullday, di->child);
|
||||||
|
|
||||||
/* FIXME: notify calendar of change */
|
/* FIXME: notify calendar of change */
|
||||||
|
|
||||||
/* FIXME: re-layout or let notification do it? */
|
/* FIXME: re-layout or let notification do it? */
|
||||||
|
Reference in New Issue
Block a user