From 897f2574fd48427e81a21692e6ec0abc8f74eee4 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 26 Nov 2007 10:20:59 +0000 Subject: ** Fix for bug #346693 2007-11-26 Milan Crha ** Fix for bug #346693 * gui/e-day-view.c: (e_day_view_on_editing_started): Ensure new event in top canvas will be visible. svn path=/trunk/; revision=34584 --- calendar/gui/e-day-view.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 598404b673..45de0472f5 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -7633,16 +7633,22 @@ e_day_view_on_editing_started (EDayView *day_view, day_view->editing_event_num = event_num; if (day == E_DAY_VIEW_LONG_EVENT) { - gint item_y, scroll_y; + gint item_x, item_y, item_w, item_h, scroll_y; + gint start_day, end_day; e_day_view_reshape_long_event (day_view, event_num); - /* and ensure it's visible too */ - item_y = (event_num * (day_view->top_row_height + 1)) - 1; - scroll_y = gtk_adjustment_get_value (GTK_LAYOUT (day_view->top_canvas)->vadjustment); - if (item_y + day_view->top_row_height > day_view->top_canvas->allocation.height + scroll_y || - item_y < scroll_y) - gnome_canvas_scroll_to (GNOME_CANVAS (day_view->top_canvas), 0, item_y); + if (e_day_view_get_long_event_position (day_view, event_num, + &start_day, &end_day, + &item_x, &item_y, + &item_w, &item_h)) { + /* and ensure it's visible too */ + /*item_y = (event_num * (day_view->top_row_height + 1)) - 1;*/ + scroll_y = gtk_adjustment_get_value (GTK_LAYOUT (day_view->top_canvas)->vadjustment); + if (item_y + day_view->top_row_height > day_view->top_canvas->allocation.height + scroll_y || + item_y < scroll_y) + gnome_canvas_scroll_to (GNOME_CANVAS (day_view->top_canvas), 0, item_y); + } } else { day_view->resize_bars_event_day = day; day_view->resize_bars_event_num = event_num; -- cgit