? a.diff
Index: libgthumb/gthumb-marshal.list
===================================================================
RCS file: /cvs/gnome/gthumb/libgthumb/gthumb-marshal.list,v
retrieving revision 1.3
diff -u -r1.3 gthumb-marshal.list
--- libgthumb/gthumb-marshal.list	24 Feb 2003 19:01:28 -0000	1.3
+++ libgthumb/gthumb-marshal.list	14 Jan 2004 09:54:56 -0000
@@ -3,6 +3,7 @@
 VOID:INT, BOXED
 VOID:ENUM, BOOLEAN
 VOID:ENUM, ENUM
+VOID:ENUM
 VOID:POINTER, POINTER
 VOID:STRING
 VOID:VOID
Index: libgthumb/image-viewer.c
===================================================================
RCS file: /cvs/gnome/gthumb/libgthumb/image-viewer.c,v
retrieving revision 1.9
diff -u -r1.9 image-viewer.c
--- libgthumb/image-viewer.c	14 Dec 2003 17:14:41 -0000	1.9
+++ libgthumb/image-viewer.c	14 Jan 2004 09:54:56 -0000
@@ -56,6 +56,7 @@
 	ZOOM_CHANGED,
 	SIZE_CHANGED,
 	REPAINTED,
+	FIT_SCROLL,
 	SCROLL,
 	LAST_SIGNAL
 };
@@ -178,6 +179,15 @@
 			      gthumb_marshal_VOID__VOID,
 			      G_TYPE_NONE, 
 			      0);
+        image_viewer_signals[FIT_SCROLL] =
+		g_signal_new ("fit_scroll",
+			      G_TYPE_FROM_CLASS (class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (ImageViewerClass, fit_scroll),
+			      NULL, NULL,
+			      gthumb_marshal_VOID__ENUM,
+			      G_TYPE_NONE, 
+			      1, GDK_TYPE_SCROLL_DIRECTION);
 	class->set_scroll_adjustments = set_scroll_adjustments;
         widget_class->set_scroll_adjustments_signal =
 		g_signal_new ("set_scroll_adjustments",
@@ -1409,6 +1418,12 @@
 	g_return_val_if_fail (event != NULL, FALSE);
 	
 	if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_DOWN)
+		if (viewer->zoom_fit_if_larger || viewer->zoom_fit)
+			     g_signal_emit (G_OBJECT (viewer), 
+				            image_viewer_signals[FIT_SCROLL],
+			 	            0, event->direction);
+	
+	if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_DOWN)
 		adj = viewer->vadj;
 	else
 		adj = viewer->hadj;
Index: libgthumb/image-viewer.h
===================================================================
RCS file: /cvs/gnome/gthumb/libgthumb/image-viewer.h,v
retrieving revision 1.3
diff -u -r1.3 image-viewer.h
--- libgthumb/image-viewer.h	24 Feb 2003 19:01:30 -0000	1.3
+++ libgthumb/image-viewer.h	14 Jan 2004 09:54:56 -0000
@@ -169,6 +169,7 @@
                                          GtkAdjustment *hadj,
                                          GtkAdjustment *vadj);
 	void (* repainted)              (ImageViewer *viewer);
+	void (* fit_scroll)		(ImageViewer *viewer, GdkScrollDirection direction);
 
 	/* -- Key binding signals -- */
 
Index: src/gthumb-window.c
===================================================================
RCS file: /cvs/gnome/gthumb/src/gthumb-window.c,v
retrieving revision 1.84
diff -u -r1.84 gthumb-window.c
--- src/gthumb-window.c	9 Jan 2004 18:03:22 -0000	1.84
+++ src/gthumb-window.c	14 Jan 2004 09:54:57 -0000
@@ -2969,6 +2962,22 @@
 	return FALSE;
 }
 
+static gboolean
+image_scrolled_cb (GtkWidget *widget, 
+  		   GdkScrollDirection direction,
+		   GThumbWindow *window)
+{
+        if (window->setting_file_list || window->changing_directory)
+		  return TRUE;
+        
+	if (direction == GDK_SCROLL_UP)
+		window_show_next_image (window, FALSE);
+	if (direction == GDK_SCROLL_DOWN)
+		window_show_prev_image (window, FALSE);
+	
+		return TRUE;
+}		   
+
 
 static gboolean
 image_clicked_cb (GtkWidget    *widget, 
@@ -5033,6 +5042,10 @@
 				"clicked",
 				G_CALLBACK (image_clicked_cb), 
 				window);
+	g_signal_connect_after (G_OBJECT (window->viewer), 
+				"fit_scroll",
+				G_CALLBACK (image_scrolled_cb), 
+				window);
 	g_signal_connect (G_OBJECT (window->viewer), 
 			  "focus_in_event",
 			  G_CALLBACK (image_focus_changed_cb), 
		  
