[evolution-patches] Patch for #300954 (gnome bugzilla bugID)



Dear hpj,

Here is the new patch for #300954.
the related URL is:
http://bugzilla.gnome.org/show_bug.cgi?id=300954
The patch for this bug is also available on the above URL.

It is about gal part.

Will you please help me to review it?

Thanks a lot.

Yours,
Mengjie

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/ChangeLog,v
retrieving revision 1.923
diff -u -p -r1.923 ChangeLog
--- ChangeLog	11 Apr 2005 12:07:58 -0000	1.923
+++ ChangeLog	17 Apr 2005 15:14:45 -0000
@@ -1,3 +1,10 @@
+2005-04-17  Yu Mengjie  <meng-jie yu sun com>
+
+	* gal/widgets/e-reflow.c: (do_adjustment), (cursor_changed):
+	adjust scrollbar when focus has been changed.
+
+	Fixes #300954 (gnome bugzilla bugID)
+
 2005-04-11  Harish Krishnaswamy  <kharish novell com>
 
 	* gal.pc.in: bump version in include path
Index: gal/widgets/e-reflow.c
===================================================================
RCS file: /cvs/gnome/gal/gal/widgets/e-reflow.c,v
retrieving revision 1.56
diff -u -p -r1.56 e-reflow.c
--- gal/widgets/e-reflow.c	4 Mar 2005 09:16:36 -0000	1.56
+++ gal/widgets/e-reflow.c	17 Apr 2005 15:14:52 -0000
@@ -160,6 +160,39 @@ selection_row_changed (ESelectionModel *
 	e_reflow_update_selection_row (reflow, row);
 }
 
+static gboolean
+do_adjustment (gpointer user_data)
+{
+	int row;
+	GtkAdjustment *adj ;
+	gfloat value, min_value, max_value;
+
+	EReflow *reflow = user_data;
+	adj = gtk_layout_get_hadjustment (GTK_LAYOUT (GNOME_CANVAS_ITEM (reflow)->canvas));
+
+	row = reflow->cursor_row;
+
+	value = adj->value;
+
+	min_value = reflow->items[row]->x2 - adj->page_size;
+	max_value = reflow->items[row]->x1;
+
+	if (value < min_value)
+		value = min_value;
+
+	if (value > max_value)
+		value = max_value;
+
+	if (value != adj->value) {
+		adj->value = value;
+		gtk_adjustment_value_changed (adj);
+	}
+	
+	return FALSE;
+
+
+}
+
 static void
 cursor_changed (ESelectionModel *selection, int row, int col, EReflow *reflow)
 {
@@ -189,7 +222,10 @@ cursor_changed (ESelectionModel *selecti
 				      NULL);
 		}
 	}
+	g_idle_add (do_adjustment, reflow);
+	
 }
+
 
 static void
 incarnate (EReflow *reflow)


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