[evolution-patches] patch about a a11y bug



Hi,

attach is a patch about a a11y bug. it makes gnopernicus know the "selected_time_changed" when the mouse's left button click on a item in main_canvas. if the focus were on main_canvas, we should not grub it to day_view or week_view. because it may make gnopernicus read the time range of the day_view or week_view instead of the item's time.

please help me to review it. thanks a lot.

Li

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2533
diff -u -r1.2533 ChangeLog
--- ChangeLog	12 Oct 2004 07:45:09 -0000	1.2533
+++ ChangeLog	12 Oct 2004 12:21:03 -0000
@@ -1,3 +1,9 @@
+2004-10-12  Li Yuan  <li yuan sun com>
+
+	* gui/e-day-view.c: (e_day_view_on_main_canvas_button_press):
+	* gui/e-week-view.c: (e_week_view_on_button_press):
+	If main_canvas has focus, do not grub it. Emit the selected_time_changed signal after the selection day changed.
+
 2004-10-12  Not Zed  <NotZed Ximian com>
 
 	* gui/e-calendar-table.c (setup_popup_icons): removed.
Index: gui/e-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view.c,v
retrieving revision 1.253
diff -u -r1.253 e-day-view.c
--- gui/e-day-view.c	7 Oct 2004 01:42:50 -0000	1.253
+++ gui/e-day-view.c	12 Oct 2004 12:21:26 -0000
@@ -2866,7 +2866,7 @@
 			return TRUE;
 		}
 
-		if (!GTK_WIDGET_HAS_FOCUS (day_view))
+		if (!GTK_WIDGET_HAS_FOCUS (day_view) && !GTK_WIDGET_HAS_FOCUS (day_view->main_canvas))
 			gtk_widget_grab_focus (GTK_WIDGET (day_view));
 
 		if (gdk_pointer_grab (GTK_LAYOUT (widget)->bin_window, FALSE,
@@ -2874,6 +2874,7 @@
 				      | GDK_BUTTON_RELEASE_MASK,
 				      FALSE, NULL, event->time) == 0) {
 			e_day_view_start_selection (day_view, day, row);
+			g_signal_emit_by_name (day_view, "selected_time_changed");
 		}
 	} else if (event->button == 3) {
 		if (!GTK_WIDGET_HAS_FOCUS (day_view))
Index: gui/e-week-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-week-view.c,v
retrieving revision 1.224
diff -u -r1.224 e-week-view.c
--- gui/e-week-view.c	7 Oct 2004 01:42:50 -0000	1.224
+++ gui/e-week-view.c	12 Oct 2004 12:21:43 -0000
@@ -2144,7 +2144,7 @@
 
 	if (event->button == 1) {
 		/* Start the selection drag. */
-		if (!GTK_WIDGET_HAS_FOCUS (week_view))
+		if (!GTK_WIDGET_HAS_FOCUS (week_view) &&  !GTK_WIDGET_HAS_FOCUS (week_view->main_canvas))
 			gtk_widget_grab_focus (GTK_WIDGET (week_view));
 
 		if (gdk_pointer_grab (GTK_LAYOUT (widget)->bin_window, FALSE,
@@ -2154,6 +2154,7 @@
 			week_view->selection_start_day = day;
 			week_view->selection_end_day = day;
 			week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_END;
+			g_signal_emit_by_name (week_view, "selected_time_changed");
 
 			/* FIXME: Optimise? */
 			gtk_widget_queue_draw (week_view->main_canvas);


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