Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/eog/ChangeLog,v
retrieving revision 1.747
diff -u -r1.747 ChangeLog
--- ChangeLog	6 Mar 2006 22:49:02 -0000	1.747
+++ ChangeLog	12 Mar 2006 13:08:41 -0000
@@ -1,3 +1,31 @@
+2006-03-12  Jaap Haitsma  <jaap@haitsma.org>
+
+	* shell/eog-gtk-ui.xml: Add Home and End as shortcut keys for the first
+	and last images respectively
+
+	* shell/eog-window.c: 
+	(action_entries_image) Add Home and End as keyboard shortcuts for the 
+	first and last images respectively.
+
+	(action_entries_collection) Change the keyboard shortcuts of first,
+	last, next and previous image so they conform to the HIG
+	First was Ctrl+Home now Alt+Home
+	Last was Ctrl+End now Alt+End
+	Next was Ctrl+Right now Alt+Right
+	Previous was Ctrl+Left now Alt+Left 
+
+	(eog_window_key_press) If no scrollbars visible PageDown, Right and Down
+	show the next image and PageUp, Left and Up show the previous image
+
+	Fixes bug #310455 partly
+
+	* libeog/eog-scroll-view.{c|h}: 
+	Add eog_scroll_view_scrollbars_visible function
+
+	(display_key_press_event) Page up/down now scroll 3/4 of the image
+	(page) height. Fixes bug #324871
+	Ctrl PageUp/PageDown scroll left/right
+
 2006-03-06  Lucas Rocha  <lucasr@gnome.org>
 
 	* shell/eog-window.c
Index: libeog/eog-scroll-view.c
===================================================================
RCS file: /cvs/gnome/eog/libeog/eog-scroll-view.c,v
retrieving revision 1.29
diff -u -r1.29 eog-scroll-view.c
--- libeog/eog-scroll-view.c	27 Feb 2006 17:12:19 -0000	1.29
+++ libeog/eog-scroll-view.c	12 Mar 2006 13:08:42 -0000
@@ -1038,7 +1038,6 @@
 	g_signal_emit (view, view_signals [SIGNAL_ZOOM_CHANGED], 0, priv->zoom);
 }
 
-
 /*===================================
 
    internal signal callbacks
@@ -1055,6 +1054,7 @@
 	double zoom;
 	gboolean do_scroll;
 	int xofs, yofs;
+	int width, height;
 
 	view = EOG_SCROLL_VIEW (data);
 	priv = view->priv;
@@ -1064,6 +1064,9 @@
 	xofs = yofs = 0;
 	zoom = 1.0;
 
+	width = GTK_WIDGET (priv->display)->allocation.width;
+	height = GTK_WIDGET (priv->display)->allocation.height;
+
 	switch (event->keyval) {
 	case GDK_Up:
 		do_scroll = TRUE;
@@ -1073,8 +1076,13 @@
 
 	case GDK_Page_Up:
 		do_scroll = TRUE;
-		xofs = 0;
-		yofs = -SCROLL_STEP_SIZE * 4;
+		if (event->state & GDK_CONTROL_MASK) {
+			xofs = -(width * 3) / 4;
+			yofs = 0;
+		} else {
+			xofs = 0;
+			yofs = -(height * 3) / 4;
+		}
 		break;
 
 	case GDK_Down:
@@ -1085,8 +1093,13 @@
 
 	case GDK_Page_Down:
 		do_scroll = TRUE;
-		xofs = 0;
-		yofs = SCROLL_STEP_SIZE * 4;
+		if (event->state & GDK_CONTROL_MASK) {
+			xofs = (width * 3) / 4;
+			yofs = 0;
+		} else {
+			xofs = 0;
+			yofs = (height * 3) / 4;
+		}
 		break;
 
 	case GDK_Left:
@@ -1826,6 +1839,15 @@
 	*height = gdk_pixbuf_get_height (priv->pixbuf);
 }
 
+gboolean 
+eog_scroll_view_scrollbars_visible (EogScrollView *view)
+{
+	if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (view->priv->hbar)) && 
+	    !GTK_WIDGET_VISIBLE (GTK_WIDGET (view->priv->vbar)))
+		return FALSE;
+
+	return TRUE;
+}
 
 /*===================================
     object creation/freeing
Index: libeog/eog-scroll-view.h
===================================================================
RCS file: /cvs/gnome/eog/libeog/eog-scroll-view.h,v
retrieving revision 1.3
diff -u -r1.3 eog-scroll-view.h
--- libeog/eog-scroll-view.h	25 Jun 2005 02:12:03 -0000	1.3
+++ libeog/eog-scroll-view.h	12 Mar 2006 13:08:42 -0000
@@ -46,6 +46,7 @@
 void     eog_scroll_view_set_antialiasing (EogScrollView *view, gboolean state);
 void     eog_scroll_view_set_transparency (EogScrollView *view, TransparencyStyle style, GdkColor *color);
 void     eog_scroll_view_get_image_size   (EogScrollView *view, int *width, int *height, gboolean scaled);
+gboolean eog_scroll_view_scrollbars_visible (EogScrollView *view);
 
 /* zoom api */
 void     eog_scroll_view_zoom_in          (EogScrollView *view, gboolean smooth);
Index: shell/eog-gtk-ui.xml
===================================================================
RCS file: /cvs/gnome/eog/shell/eog-gtk-ui.xml,v
retrieving revision 1.15
diff -u -r1.15 eog-gtk-ui.xml
--- shell/eog-gtk-ui.xml	9 Jan 2006 04:35:50 -0000	1.15
+++ shell/eog-gtk-ui.xml	12 Mar 2006 13:08:42 -0000
@@ -76,4 +76,6 @@
   <accelerator name="ShiftReturnAccel" action="ShiftReturn"/>
   <accelerator name="BackSpaceAccel" action="BackSpace"/>
   <accelerator name="DeleteAccel" action="Delete"/>
+  <accelerator name="EndAccel" action="End"/>
+  <accelerator name="HomeAccel" action="Home"/>
 </ui>
Index: shell/eog-window.c
===================================================================
RCS file: /cvs/gnome/eog/shell/eog-window.c,v
retrieving revision 1.185
diff -u -r1.185 eog-window.c
--- shell/eog-window.c	6 Mar 2006 22:49:03 -0000	1.185
+++ shell/eog-window.c	12 Mar 2006 13:08:43 -0000
@@ -2526,23 +2526,37 @@
 
 	result = FALSE;
 
-	if (GTK_WIDGET_CLASS (parent_class)->key_press_event)
-		result = (* GTK_WIDGET_CLASS (parent_class)->key_press_event) (widget, event);
-
-	if (result)
-		return result;
-
 	switch (event->keyval) {
 	case GDK_Q:
 	case GDK_q:
 		eog_window_close (EOG_WINDOW (widget));
+		result = TRUE;
+		break;
+	case GDK_Up:
+	case GDK_Left:
+	case GDK_Page_Up:
+		if (!eog_scroll_view_scrollbars_visible (EOG_SCROLL_VIEW (EOG_WINDOW (widget)->priv->scroll_view))) {
+			eog_wrap_list_select_single (EOG_WRAP_LIST (EOG_WINDOW(widget)->priv->wraplist), 
+						     EOG_WRAP_LIST_SELECT_LEFT);
+			result = TRUE;		
+		}
 		break;
+	case GDK_Down:
+	case GDK_Right:
+	case GDK_Page_Down:
+		if (!eog_scroll_view_scrollbars_visible (EOG_SCROLL_VIEW (EOG_WINDOW (widget)->priv->scroll_view))) {
+			eog_wrap_list_select_single (EOG_WRAP_LIST (EOG_WINDOW(widget)->priv->wraplist), 
+						     EOG_WRAP_LIST_SELECT_RIGHT);
+			result = TRUE;
+		}
+		break;
+	}
 
-	default:
-		return FALSE;
+	if (result == FALSE && GTK_WIDGET_CLASS (parent_class)->key_press_event) {
+		result = (* GTK_WIDGET_CLASS (parent_class)->key_press_event) (widget, event);
 	}
 
-	return TRUE;
+	return result;
 }
 
 /* Returns whether a window has an image loaded in it */
@@ -3316,6 +3330,8 @@
   { "ShiftReturn", NULL, N_("_Previous Image"), "<shift>Return", NULL, G_CALLBACK (verb_GoPrev_cb) },
   { "BackSpace", NULL, N_("_Previous Image"), "BackSpace", NULL, G_CALLBACK (verb_GoPrev_cb) },
   { "Delete", NULL, N_("Move to _Trash"), "Delete", NULL, G_CALLBACK (verb_MoveToTrash_cb) },
+  { "Home", NULL, N_("_First Image"), "Home", NULL, G_CALLBACK (verb_GoFirst_cb) },
+  { "End", NULL, N_("_Last Image"), "End", NULL, G_CALLBACK (verb_GoLast_cb) },
 };
 
 static const GtkToggleActionEntry toggle_entries_image[] = {
@@ -3323,10 +3339,10 @@
 };
 
 static const GtkActionEntry action_entries_collection[] = {
-  { "GoPrevious", GTK_STOCK_GO_BACK, N_("_Previous Image"), "<control>Page_Up", NULL, G_CALLBACK (verb_GoPrev_cb) },
-  { "GoNext", GTK_STOCK_GO_FORWARD, N_("_Next Image"), "<control>Page_Down", NULL, G_CALLBACK (verb_GoNext_cb) },
-  { "GoFirst", GTK_STOCK_GOTO_FIRST, N_("_First Image"), "<control>Home", NULL, G_CALLBACK (verb_GoFirst_cb) },
-  { "GoLast", GTK_STOCK_GOTO_LAST, N_("_Last Image"), "<control>End", NULL, G_CALLBACK (verb_GoLast_cb) },
+  { "GoPrevious", GTK_STOCK_GO_BACK, N_("_Previous Image"), "<Alt>Left", NULL, G_CALLBACK (verb_GoPrev_cb) },
+  { "GoNext", GTK_STOCK_GO_FORWARD, N_("_Next Image"), "<Alt>Right", NULL, G_CALLBACK (verb_GoNext_cb) },
+  { "GoFirst", GTK_STOCK_GOTO_FIRST, N_("_First Image"), "<Alt>Home", NULL, G_CALLBACK (verb_GoFirst_cb) },
+  { "GoLast", GTK_STOCK_GOTO_LAST, N_("_Last Image"), "<Alt>End", NULL, G_CALLBACK (verb_GoLast_cb) },
 };
 
 typedef struct {
