[evolution-patches] fix for the bug #321088 [calendar]



Hi,
  Have attached the fix for the bug. Reduced the canvas area so that the
effect movement in a wrong direction is not visible. Set the
scroll_increment to days width. Show only 35 days in the canvas since we
query free/busy only for those. Set the canvas view to meetings day
start instead of time.

thanks, Chenthill.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2838
diff -u -p -r1.2838 ChangeLog
--- ChangeLog	9 Nov 2005 11:49:36 -0000	1.2838
+++ ChangeLog	10 Nov 2005 09:53:00 -0000
@@ -1,3 +1,13 @@
+2005-11-10  Chenthill Palanisamy  <pchenthill novell com>
+
+	Fixes #321088
+	* gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
+	(e_meeting_time_selector_style_set),
+	(e_meeting_time_selector_ensure_meeting_time_shown): Set the 
+	scroll_increment to days width. Show only 35 days in the canvas
+	since we query freebusy only for those. Set the canvas view to 
+	meetings day start instead of time.
+
 2005-11-09  Veerapuram Varadhan <vvaradhan novell com>
 
 	Committing for Nathan Owens <pianocomp81 yahoo com>	
Index: gui/e-meeting-time-sel.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-meeting-time-sel.c,v
retrieving revision 1.70
diff -u -p -r1.70 e-meeting-time-sel.c
--- gui/e-meeting-time-sel.c	6 Oct 2005 18:21:51 -0000	1.70
+++ gui/e-meeting-time-sel.c	10 Nov 2005 09:53:01 -0000
@@ -82,10 +82,10 @@ const gchar *EMeetingTimeSelectorHours12
 };
 
 /* The number of days shown in the entire canvas. */
-#define E_MEETING_TIME_SELECTOR_DAYS_SHOWN		365
-#define E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE	 60
-#define E_MEETING_TIME_SELECTOR_FB_DAYS_BEFORE            7
-#define E_MEETING_TIME_SELECTOR_FB_DAYS_AFTER            28
+#define E_MEETING_TIME_SELECTOR_DAYS_SHOWN	   	35	
+#define E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE	7 
+#define E_MEETING_TIME_SELECTOR_FB_DAYS_BEFORE          7
+#define E_MEETING_TIME_SELECTOR_FB_DAYS_AFTER           28
 
 /* This is the number of pixels between the mouse has to move before the
    scroll speed is incremented. */
@@ -382,7 +382,7 @@ e_meeting_time_selector_construct (EMeet
 	gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (sw), GTK_LAYOUT (mts->display_main)->vadjustment);
 
 	mts->hscrollbar = gtk_hscrollbar_new (GTK_LAYOUT (mts->display_main)->hadjustment);
-	GTK_LAYOUT (mts->display_main)->hadjustment->step_increment = mts->col_width;
+	GTK_LAYOUT (mts->display_main)->hadjustment->step_increment = mts->day_width;
 	gtk_table_attach (GTK_TABLE (mts), mts->hscrollbar,
 			  1, 4, 2, 3, GTK_EXPAND | GTK_FILL, 0, 0, 0);
 	gtk_widget_show (mts->hscrollbar);
@@ -951,7 +951,7 @@ e_meeting_time_selector_style_set (GtkWi
 
 	gtk_widget_set_usize (mts->attendees_vbox_spacer, 1, mts->row_height * 2 - 6);
 
-	GTK_LAYOUT (mts->display_main)->hadjustment->step_increment = mts->col_width;
+	GTK_LAYOUT (mts->display_main)->hadjustment->step_increment = mts->day_width;
 	GTK_LAYOUT (mts->display_main)->vadjustment->step_increment = mts->row_height;
 
 	g_object_unref (layout);
@@ -2675,7 +2675,7 @@ e_meeting_time_selector_ensure_meeting_t
 {
 	gint start_x, end_x, scroll_x, scroll_y, canvas_width;
 	gint new_scroll_x;
-	gboolean fits_in_canvas;
+	EMeetingTime time;
 
 	/* Check if we need to change the range of dates shown. */
 	if (g_date_compare (&mts->meeting_start_time.date,
@@ -2688,23 +2688,21 @@ e_meeting_time_selector_ensure_meeting_t
 	}
 
 	/* If all of the meeting time is visible, just return. */
-	e_meeting_time_selector_get_meeting_time_positions (mts, &start_x,
-							    &end_x);
+	if (e_meeting_time_selector_get_meeting_time_positions (mts, &start_x,
+							    &end_x)) {
+		time.date = mts->meeting_start_time.date;
+		time.hour = 0;
+		time.minute = 0;
+		start_x = e_meeting_time_selector_calculate_time_position (mts, &time);
+	}
+	
 	gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main),
 					 &scroll_x, &scroll_y);
 	canvas_width = mts->display_main->allocation.width;
 	if (start_x > scroll_x && end_x <= scroll_x + canvas_width)
 		return;
 
-	fits_in_canvas = end_x - start_x < canvas_width ? TRUE : FALSE;
-
-	/* If the meeting is not entirely visible, either center it if it is
-	   smaller than the canvas, or show the start of it if it is big. */
-	if (fits_in_canvas) {
-		new_scroll_x = (start_x + end_x - canvas_width) / 2;
-	} else {
-		new_scroll_x = start_x;
-	}
+	new_scroll_x = start_x;
 	gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main),
 				new_scroll_x, scroll_y);
 }


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