--- epiphany-y/ChangeLog	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/ChangeLog	2003-05-19 22:37:16.000000000 +0200
@@ -1,3 +1,51 @@
+2003-05-19  Christian Persch <chpe+gnomebugz@stud.uni-saarland.de>
+
+	Simplified and reorganised zoom. Implement a zoom control for the
+	toolbar.
+
+	* lib/widgets/ephy-zoom-action.h:
+	* lib/widgets/ephy-zoom-action.c:
+	* lib/widgets/ephy-zoom-control.h:
+	* lib/widgets/ephy-zoom-control.c:
+
+	New. A simple zoom control and a corresponding egg action.
+
+	* lib/ephy-zoom.h:
+	* lib/ephy-zoom.c:
+
+	New. Define the supported zoom levels, plus some helper functions.
+
+	* data/ui/epiphany-toolbar.xml.in:
+	* src/toolbar.h:
+	* src/toolbar.c: (toolbar_update_zoom_control),
+	(zoom_to_level_cb), (toolbar_setup_actions):
+
+	Hook up zoom control.
+
+	* src/ephy-window.c: (toolbar_update_zoom_control):
+
+	New. Updates toolbar zoom control and menu item sensitivity.
+
+	* embed/mozilla/mozilla-embed.c: (impl_zoom_set, impl_zoom_get):
+	* embed/ephy-embed.[ch]: (zoom_set), (zoom_get), (ephy_embed_zoom_set),
+	(ephy_embed_zoom_get):
+	* lib/ephy-marshal.list:
+	* src/ephy-nautilus-view.c: (gnv_embed_zoom_change_cb),
+	(gnv_zoomable_set_zoom_level_cb):
+	* src/ephy-tab.c: (ephy_tab_zoom_changed_cb):
+	* src/ephy-window.c: (ephy_window_set_zoom):
+
+	Use float zoom factor instead of int percent for zoom.
+
+	* src/ephy-nautilus-view.c: (ephy_nautilus_view_instance_init),
+	(ephy_nautilus_view_class_init), (gnv_zoomable_set_zoom_level_cb),
+	(gnv_zoomable_zoom_in_cb), (gnv_zoomable_zoom_out_cb),
+	(gnv_zoomable_zoom_to_default_cb), (gnv_embed_zoom_change_cb):
+	* src/window-commands.c: (window_cmd_view_zoom_in),
+	(window_cmd_view_zoom_out), (window_cmd_view_zoom_normal):
+
+	Simplified; use ephy-zoom.h where appropriate.
+
 2003-05-18  Marco Pesenti Gritti  <marco@it.gnome.org>
 
 	* Makefile.am:
--- epiphany-y/data/ui/epiphany-toolbar.xml.in	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/data/ui/epiphany-toolbar.xml.in	2003-05-12 21:19:32.000000000 +0200
@@ -20,6 +20,7 @@
 	<toolitem verb="Location"/>
 	<toolitem verb="Spinner"/>
 	<toolitem verb="ToolbarGo"/>
+	<toolitem verb="Zoom"/>
 </available>
 <toolbar name="DefaultToolbar">
 	<toolitem verb="NavigationBack"/>
--- epiphany-y/lib/widgets/Makefile.am	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/lib/widgets/Makefile.am	2003-05-18 18:33:48.000000000 +0200
@@ -28,5 +32,8 @@
 	ephy-tree-model-node.c			\
 	ephy-tree-model-node.h			\
 	ephy-tree-model-sort.c			\
-	ephy-tree-model-sort.h
-
+	ephy-tree-model-sort.h			\
+	ephy-zoom-action.h			\
+	ephy-zoom-action.c			\
+	ephy-zoom-control.c			\
+	ephy-zoom-control.h
--- epiphany-y/lib/widgets/ephy-zoom-control.h	1970-01-01 01:00:00.000000000 +0100
+++ epiphany-build/lib/widgets/ephy-zoom-control.h	2003-05-14 14:43:00.000000000 +0200
@@ -0,0 +1,66 @@
+/*
+ *  Copyright (C) 2003  Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef EPHY_ZOOM_CONTROL_H
+#define EPHY_ZOOM_CONTROL_H
+
+#include "eggtoolitem.h"
+
+G_BEGIN_DECLS
+
+/* object forward declarations */
+
+typedef struct _EphyZoomControl EphyZoomControl;
+typedef struct _EphyZoomControlClass EphyZoomControlClass;
+typedef struct _EphyZoomControlPrivate EphyZoomControlPrivate;
+
+/**
+ * EphyZoomControl object
+ */
+
+#define EPHY_TYPE_ZOOM_CONTROL			(ephy_zoom_control_get_type())
+#define EPHY_ZOOM_CONTROL(object)		(G_TYPE_CHECK_INSTANCE_CAST((object), EPHY_TYPE_ZOOM_CONTROL, EphyZoomControl))
+#define EPHY_ZOOM_CONTROL_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST((klass), EPHY_TYPE_ZOOM_CONTROL, EphyZoomControlClass))
+#define EPHY_IS_ZOOM_CONTROL(object)		(G_TYPE_CHECK_INSTANCE_TYPE((object), EPHY_TYPE_ZOOM_CONTROL))
+#define EPHY_IS_ZOOM_CONTROL_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), EPHY_TYPE_ZOOM_CONTROL))
+#define EPHY_ZOOM_CONTROL_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), EPHY_TYPE_ZOOM_CONTROL, EphyZoomControlClass))
+
+struct _EphyZoomControlClass
+{
+	EggToolItemClass parent_class;
+
+	/* signals */
+	void (*zoom_to_level) 	(EphyZoomControl *control, float level);
+};
+
+struct _EphyZoomControl
+{
+	EggToolItem parent_object;
+
+	EphyZoomControlPrivate *priv;
+};
+
+GType	ephy_zoom_control_get_type	 (void);
+
+void	ephy_zoom_control_set_zoom_level (EphyZoomControl *control, float zoom);
+
+float	ephy_zoom_control_get_zoom_level (EphyZoomControl *control);
+
+G_END_DECLS
+
+#endif
--- epiphany-y/lib/widgets/ephy-zoom-control.c	1970-01-01 01:00:00.000000000 +0100
+++ epiphany-build/lib/widgets/ephy-zoom-control.c	2003-05-19 22:04:57.000000000 +0200
@@ -0,0 +1,340 @@
+/*
+ *  Copyright (C) 2003  Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ephy-zoom-control.h"
+#include "ephy-marshal.h"
+#include "ephy-zoom.h"
+
+#include <gtk/gtk.h>
+#include <gtk/gtkmenu.h>
+#include <gtk/gtkoptionmenu.h>
+#include <bonobo/bonobo-i18n.h>
+
+/**
+ * Private data
+ */
+struct _EphyZoomControlPrivate
+{
+	GtkWidget *option_menu;
+	float zoom;
+	guint handler_id;
+};
+
+enum
+{
+	PROP_0,
+	PROP_ZOOM
+};
+
+enum
+{
+	ZOOM_TO_LEVEL_SIGNAL,
+	LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
+
+static GObjectClass *parent_class = NULL;
+
+static void	ephy_zoom_control_class_init	(EphyZoomControlClass *klass);
+static void	ephy_zoom_control_init		(EphyZoomControl *control);
+static void	ephy_zoom_control_finalize	(GObject *o);
+
+#define MENU_ID "ephy-zoom-control-menu-id"
+
+/**
+ * EphyZoomControl object
+ */
+
+GType
+ephy_zoom_control_get_type (void)
+{
+        static GType ephy_zoom_control_type = 0;
+
+        if (ephy_zoom_control_type == 0)
+        {
+                static const GTypeInfo our_info =
+			{
+				sizeof (EphyZoomControlClass),
+				NULL, /* base_init */
+				NULL, /* base_finalize */
+				(GClassInitFunc) ephy_zoom_control_class_init,
+				NULL,
+				NULL, /* class_data */
+				sizeof (EphyZoomControl),
+				0, /* n_preallocs */
+				(GInstanceInitFunc) ephy_zoom_control_init,
+			};
+
+                ephy_zoom_control_type = g_type_register_static (EGG_TYPE_TOOL_ITEM,
+								 "EphyZoomControl",
+								 &our_info, 0);
+        }
+
+        return ephy_zoom_control_type;
+}
+
+static void
+proxy_menu_activate_cb (GtkMenuItem *menu_item, gpointer data)
+{
+	EphyZoomControl *control;
+	gint index;
+	float zoom;
+
+	g_return_if_fail (EPHY_IS_ZOOM_CONTROL (data));
+	control = EPHY_ZOOM_CONTROL (data);
+	
+	/* menu item was toggled OFF */
+	if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menu_item))) return;
+
+	index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menu_item), "zoom-level"));
+	zoom = zoom_levels[index].level;
+
+	if (zoom != control->priv->zoom)
+	{
+		g_signal_emit (control, signals[ZOOM_TO_LEVEL_SIGNAL], 0, zoom);
+	}
+}
+
+static gboolean
+ephy_zoom_control_create_menu_proxy (EggToolItem *item)
+{
+	EphyZoomControl *control = EPHY_ZOOM_CONTROL (item);
+	EphyZoomControlPrivate *p = control->priv;
+	GtkWidget *menu, *menu_item;
+	GSList *group = NULL;
+	gint i;
+
+	menu = gtk_menu_new ();
+
+	for (i = 0; i < n_zoom_levels; i++)
+	{
+		menu_item = gtk_radio_menu_item_new_with_label (group, _(zoom_levels[i].name));
+		group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
+
+		gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item),
+						p->zoom == zoom_levels[i].level);
+
+		gtk_widget_show (menu_item);
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+
+		g_object_set_data (G_OBJECT (menu_item), "zoom-level", GINT_TO_POINTER (i));
+		g_signal_connect (G_OBJECT (menu_item), "activate",
+				  G_CALLBACK (proxy_menu_activate_cb), control);
+	}
+
+	menu_item = gtk_menu_item_new_with_mnemonic (_("_Zoom"));
+	gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), menu);
+
+	gtk_widget_show (menu);
+	gtk_widget_show (menu_item);
+
+	g_object_ref (menu_item);
+	gtk_object_sink (GTK_OBJECT (menu_item));
+	egg_tool_item_set_proxy_menu_item (item, MENU_ID, menu_item);
+	g_object_unref (menu_item);
+
+	return TRUE;
+}
+
+static void
+option_menu_changed_cb (GtkOptionMenu *option_menu, EphyZoomControl *control)
+{
+	gint index;
+	float zoom;
+
+	index = gtk_option_menu_get_history (option_menu);
+	zoom = zoom_levels[index].level;
+
+	if (zoom != control->priv->zoom)
+	{
+		g_signal_emit (control, signals[ZOOM_TO_LEVEL_SIGNAL], 0, zoom);	
+	}
+}
+
+static void
+sync_zoom_cb (EphyZoomControl *control, GParamSpec *pspec, gpointer data)
+{
+	EphyZoomControlPrivate *p = control->priv;
+	guint index;
+
+	index = ephy_zoom_get_zoom_level_index (p->zoom);
+
+	g_signal_handler_block (p->option_menu, p->handler_id);
+	gtk_option_menu_set_history (GTK_OPTION_MENU (p->option_menu), index);
+	g_signal_handler_unblock (p->option_menu, p->handler_id);	
+}
+
+static void
+ephy_zoom_control_init (EphyZoomControl *control)
+{
+	EphyZoomControlPrivate *p;
+	GtkWidget *item, *menu, *box;
+	guint i;
+
+	p = g_new0 (EphyZoomControlPrivate, 1);
+	control->priv = p;
+
+	p->zoom = 1.0;
+
+	p->option_menu = gtk_option_menu_new ();
+	menu = gtk_menu_new ();
+
+	for (i = 0; i < n_zoom_levels; i++)
+	{
+		item = gtk_menu_item_new_with_label (_(zoom_levels[i].name));
+		gtk_menu_shell_append  (GTK_MENU_SHELL (menu),item);
+
+		gtk_widget_show (item);
+	}
+
+	gtk_option_menu_set_menu (GTK_OPTION_MENU (p->option_menu), menu);
+	gtk_widget_show (menu);
+	gtk_widget_show (p->option_menu);
+
+	i = ephy_zoom_get_zoom_level_index (p->zoom);
+	gtk_option_menu_set_history (GTK_OPTION_MENU (p->option_menu), i);
+
+	box = gtk_vbox_new (TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (box), p->option_menu, TRUE, FALSE, 0);
+	gtk_widget_show (box);
+
+	gtk_container_add (GTK_CONTAINER (control), box);
+	gtk_container_set_border_width (GTK_CONTAINER (control), 3);
+
+	p->handler_id = g_signal_connect (p->option_menu, "changed",
+					  G_CALLBACK (option_menu_changed_cb), control);
+	
+	g_signal_connect (control, "notify::zoom",
+			  G_CALLBACK (sync_zoom_cb), NULL);
+}
+
+static void
+ephy_zoom_control_set_property (GObject *object,
+				guint prop_id,
+				const GValue *value,
+				GParamSpec *pspec)
+{
+	EphyZoomControl *control;
+	EphyZoomControlPrivate *p;
+
+	control = EPHY_ZOOM_CONTROL (object);
+	p = control->priv;
+
+	switch (prop_id)
+	{
+		case PROP_ZOOM:
+			p->zoom = g_value_get_float (value);
+			g_object_notify (object, "zoom");
+			break;
+	}
+}
+
+static void
+ephy_zoom_control_get_property (GObject *object,
+				guint prop_id,
+				GValue *value,
+				GParamSpec *pspec)
+{
+	EphyZoomControl *control;
+	EphyZoomControlPrivate *p;
+
+	control = EPHY_ZOOM_CONTROL (object);
+	p = control->priv;
+
+	switch (prop_id)
+	{
+		case PROP_ZOOM:
+			g_value_set_float (value, p->zoom);
+			break;
+	}
+}
+
+static void
+ephy_zoom_control_class_init (EphyZoomControlClass *klass)
+{
+	GObjectClass *object_class;
+	EggToolItemClass *tool_item_class;
+
+	parent_class = g_type_class_peek_parent (klass);
+
+	object_class = (GObjectClass *)klass;
+	tool_item_class = (EggToolItemClass *)klass;
+
+	object_class->set_property = ephy_zoom_control_set_property;
+	object_class->get_property = ephy_zoom_control_get_property;
+	object_class->finalize = ephy_zoom_control_finalize;
+
+	tool_item_class->create_menu_proxy = ephy_zoom_control_create_menu_proxy;
+
+	signals[ZOOM_TO_LEVEL_SIGNAL] =
+		g_signal_new ("zoom_to_level",
+		              G_TYPE_FROM_CLASS (klass),
+		              G_SIGNAL_RUN_LAST,
+		              G_STRUCT_OFFSET (EphyZoomControlClass,
+					       zoom_to_level),
+		              NULL, NULL,
+		              g_cclosure_marshal_VOID__FLOAT,
+		              G_TYPE_NONE,
+			      1,
+			      G_TYPE_FLOAT);
+
+	g_object_class_install_property (object_class,
+					 PROP_ZOOM,
+					 g_param_spec_float ("zoom",
+							     _("Zoom"),
+							     _("Zoom level to display in the item."),
+							     ZOOM_MINIMAL,
+							     ZOOM_MAXIMAL,
+							     1.0,
+							     G_PARAM_READWRITE));
+}
+
+static void
+ephy_zoom_control_finalize (GObject *o)
+{
+	EphyZoomControl *control = EPHY_ZOOM_CONTROL (o);
+
+	g_free (control->priv);
+
+	G_OBJECT_CLASS (parent_class)->finalize (o);
+}
+
+
+void
+ephy_zoom_control_set_zoom_level (EphyZoomControl *control, float zoom)
+{
+	g_return_if_fail (EPHY_IS_ZOOM_CONTROL (control));
+	
+	if (zoom < ZOOM_MINIMAL || zoom > ZOOM_MAXIMAL) return;
+
+	control->priv->zoom = zoom;
+	g_object_notify (G_OBJECT (control), "zoom");
+}
+
+float
+ephy_zoom_control_get_zoom_level (EphyZoomControl *control)
+{
+	g_return_val_if_fail (EPHY_IS_ZOOM_CONTROL (control), 1.0);
+	
+	return control->priv->zoom;
+}
--- epiphany-y/lib/widgets/ephy-zoom-action.h	1970-01-01 01:00:00.000000000 +0100
+++ epiphany-build/lib/widgets/ephy-zoom-action.h	2003-05-18 11:45:02.000000000 +0200
@@ -0,0 +1,60 @@
+/*
+ *  Copyright (C) 2003 Marco Pesenti Gritti
+ *  Copyright (C) 2003 Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef EPHY_ZOOM_ACTION_H
+#define EPHY_ZOOM_ACTION_H
+
+#include <egg-action.h>
+
+G_BEGIN_DECLS
+
+#define EPHY_TYPE_ZOOM_ACTION            (ephy_zoom_action_get_type ())
+#define EPHY_ZOOM_ACTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_ZOOM_ACTION, EphyZoomAction))
+#define EPHY_ZOOM_ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_TYPE_ZOOM_ACTION, EphyZoomActionClass))
+#define EPHY_IS_ZOOM_ACTION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_TYPE_ZOOM_ACTION))
+#define EPHY_IS_ZOOM_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EPHY_TYPE_ZOOM_ACTION))
+#define EPHY_ZOOM_ACTION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), EPHY_TYPE_ZOOM_ACTION, EphyZoomActionClass))
+
+typedef struct _EphyZoomAction		EphyZoomAction;
+typedef struct _EphyZoomActionClass	EphyZoomActionClass;
+typedef struct _EphyZoomActionPrivate	EphyZoomActionPrivate;
+
+struct _EphyZoomAction
+{
+	EggAction parent;
+	
+	EphyZoomActionPrivate *priv;
+};
+
+struct _EphyZoomActionClass
+{
+	EggActionClass parent_class;
+
+	void (* zoom_to_level)	(EphyZoomAction *action, float level);
+};
+
+GType	ephy_zoom_action_get_type	(void);
+
+void	ephy_zoom_action_set_zoom_level	(EphyZoomAction *action, float zoom);
+
+float	ephy_zoom_action_get_zoom_level	(EphyZoomAction *action);
+
+G_END_DECLS
+
+#endif
--- epiphany-y/lib/widgets/ephy-zoom-action.c	1970-01-01 01:00:00.000000000 +0100
+++ epiphany-build/lib/widgets/ephy-zoom-action.c	2003-05-19 22:06:29.000000000 +0200
@@ -0,0 +1,224 @@
+/*
+ *  Copyright (C) 2003 Marco Pesenti Gritti
+ *  Copyright (C) 2003 Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ephy-zoom-action.h"
+#include "ephy-zoom-control.h"
+#include "ephy-zoom.h"
+
+#include <glib-object.h>
+#include <bonobo/bonobo-i18n.h>
+
+struct _EphyZoomActionPrivate
+{
+	float zoom;
+};
+
+enum
+{
+	PROP_0,
+	PROP_ZOOM
+};
+
+
+static void ephy_zoom_action_init       (EphyZoomAction *action);
+static void ephy_zoom_action_class_init (EphyZoomActionClass *class);
+static void ephy_zoom_action_finalize	(GObject *object);
+
+enum
+{
+	ZOOM_TO_LEVEL_SIGNAL,
+	LAST_SIGNAL
+};
+
+static guint ephy_zoom_action_signals[LAST_SIGNAL] = { 0 };
+
+static GObjectClass *parent_class = NULL;
+
+GType
+ephy_zoom_action_get_type (void)
+{
+        static GType ephy_zoom_action_type = 0;
+
+        if (ephy_zoom_action_type == 0)
+        {
+                static const GTypeInfo our_info =
+			{
+				sizeof (EphyZoomActionClass),
+				NULL, /* base_init */
+				NULL, /* base_finalize */
+				(GClassInitFunc) ephy_zoom_action_class_init,
+				NULL,
+				NULL, /* class_data */
+				sizeof (EphyZoomAction),
+				0, /* n_preallocs */
+				(GInstanceInitFunc) ephy_zoom_action_init,
+			};
+
+                ephy_zoom_action_type = g_type_register_static (EGG_TYPE_ACTION,
+								"EphyZoomAction",
+								&our_info, 0);
+        }
+
+        return ephy_zoom_action_type;
+}
+
+static void
+zoom_to_level_cb (EphyZoomControl *control,
+		  float zoom,
+		  EphyZoomAction *action)
+{
+	g_signal_emit (action,
+		       ephy_zoom_action_signals[ZOOM_TO_LEVEL_SIGNAL],
+		       0, zoom);
+}
+
+static void
+sync_zoom_cb (EggAction *action, GParamSpec *pspec, GtkWidget *proxy)
+{
+	EphyZoomAction *zoom_action = EPHY_ZOOM_ACTION (action);
+
+	g_object_set (G_OBJECT (proxy), "zoom", zoom_action->priv->zoom, NULL);
+}
+
+static void
+connect_proxy (EggAction *action, GtkWidget *proxy)
+{
+	g_signal_connect (action, "notify::zoom",
+			  G_CALLBACK (sync_zoom_cb), proxy);
+
+	g_signal_connect (proxy, "zoom_to_level", GTK_SIGNAL_FUNC(zoom_to_level_cb), action);
+
+	EGG_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+}
+
+static void
+ephy_zoom_action_set_property (GObject *object,
+			       guint prop_id,
+			       const GValue *value,
+			       GParamSpec *pspec)
+{
+	EphyZoomAction *action;
+
+	action = EPHY_ZOOM_ACTION (object);
+
+	switch (prop_id)
+	{
+		case PROP_ZOOM:
+			action->priv->zoom = g_value_get_float (value);
+			g_object_notify (object, "zoom");
+			break;
+	}
+}
+
+static void
+ephy_zoom_action_get_property (GObject *object,
+			       guint prop_id,
+			       GValue *value,
+			       GParamSpec *pspec)
+{
+	EphyZoomAction *action;
+
+	action = EPHY_ZOOM_ACTION (object);
+
+	switch (prop_id)
+	{
+		case PROP_ZOOM:
+			g_value_set_float (value, action->priv->zoom);
+			break;
+	}
+}
+
+static void
+ephy_zoom_action_class_init (EphyZoomActionClass *class)
+{
+	EggActionClass *action_class;
+	GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+	object_class->set_property = ephy_zoom_action_set_property;
+	object_class->get_property = ephy_zoom_action_get_property;
+	object_class->finalize = ephy_zoom_action_finalize;
+
+	parent_class = g_type_class_peek_parent (class);
+	action_class = EGG_ACTION_CLASS (class);
+
+	action_class->toolbar_item_type = EPHY_TYPE_ZOOM_CONTROL;
+	action_class->connect_proxy = connect_proxy;
+
+	g_object_class_install_property (object_class,
+					 PROP_ZOOM,
+					 g_param_spec_float ("zoom",
+							     "Zoom",
+							     "Zoom",
+							     ZOOM_MINIMAL,
+							     ZOOM_MAXIMAL,
+							     1.0,
+							     G_PARAM_READWRITE));
+
+	ephy_zoom_action_signals[ZOOM_TO_LEVEL_SIGNAL] =
+		g_signal_new ("zoom_to_level",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (EphyZoomActionClass, zoom_to_level),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__FLOAT,
+			      G_TYPE_NONE,
+			      1,
+			      G_TYPE_FLOAT);
+}
+
+static void
+ephy_zoom_action_init (EphyZoomAction *action)
+{
+	action->priv = g_new0 (EphyZoomActionPrivate, 1);
+
+	action->priv->zoom = 1.0;
+}
+
+static void
+ephy_zoom_action_finalize (GObject *object)
+{
+	EphyZoomAction *action = EPHY_ZOOM_ACTION (object);
+
+	g_free (action->priv);
+
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+void
+ephy_zoom_action_set_zoom_level (EphyZoomAction *action, float zoom)
+{
+	g_return_if_fail (EPHY_IS_ZOOM_ACTION (action));
+	
+	if (zoom < ZOOM_MINIMAL || zoom > ZOOM_MAXIMAL) return;
+
+	action->priv->zoom = zoom;
+	g_object_notify (G_OBJECT (action), "zoom");
+}
+
+float
+ephy_zoom_action_get_zoom_level (EphyZoomAction *action)
+{
+	g_return_val_if_fail (EPHY_IS_ZOOM_ACTION (action), 1.0);
+	
+	return action->priv->zoom;
+}
--- epiphany-y/lib/Makefile.am	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/lib/Makefile.am	2003-05-12 11:21:24.000000000 +0200
@@ -54,7 +54,9 @@
 	ephy-stock-icons.h			\
 	ephy-thread-helpers.c			\
 	ephy-thread-helpers.h			\
-	ephy-types.h
+	ephy-types.h				\
+	ephy-zoom.h				\
+	ephy-zoom.c
 
 libephy_la_LIBADD = \
 	$(top_builddir)/lib/widgets/libephywidgets.la	\
--- epiphany-y/lib/ephy-marshal.list	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/lib/ephy-marshal.list	2003-04-25 00:13:28.000000000 +0200
@@ -15,3 +15,4 @@
 VOID:INT,INT,INT
 INT:OBJECT
 VOID:POINTER,POINTER
+VOID:FLOAT
--- epiphany-y/lib/ephy-zoom.h	1970-01-01 01:00:00.000000000 +0100
+++ epiphany-build/lib/ephy-zoom.h	2003-05-18 11:41:08.000000000 +0200
@@ -0,0 +1,64 @@
+/*
+ *  Copyright (C) 2003 Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef EPHY_ZOOM_H
+#define EPHY_ZOOM_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib.h>
+#include <bonobo/bonobo-i18n.h>
+
+G_BEGIN_DECLS
+
+static const
+struct
+{
+	gchar *name;
+	float level;
+}
+zoom_levels[] =
+{
+	{ N_("50%"), 0.7071067811 },
+	{ N_("75%"), 0.8408964152 },
+	{ N_("100%"), 1.0 },
+	{ N_("125%"), 1.1892071149 },
+	{ N_("150%"), 1.4142135623 },
+	{ N_("175%"), 1.6817928304 },
+	{ N_("200%"), 2.0 },
+	{ N_("300%"), 2.8284271247 },
+	{ N_("400%"), 4.0 }
+};
+static const guint n_zoom_levels = G_N_ELEMENTS (zoom_levels);
+
+#define ZOOM_MINIMAL	(zoom_levels[0].level)
+#define ZOOM_MAXIMAL	(zoom_levels[n_zoom_levels - 1].level)
+#define ZOOM_IN		(-1.0)
+#define ZOOM_OUT	(-2.0)
+
+guint	ephy_zoom_get_zoom_level_index	 (float level);
+
+float	ephy_zoom_get_changed_zoom_level (float level, gint steps);
+
+float	ephy_zoom_get_nearest_zoom_level (float level);
+
+G_END_DECLS
+
+#endif
--- epiphany-y/lib/ephy-zoom.c	1970-01-01 01:00:00.000000000 +0100
+++ epiphany-build/lib/ephy-zoom.c	2003-05-15 21:23:43.000000000 +0200
@@ -0,0 +1,57 @@
+/*
+ *  Copyright (C) 2003 Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "ephy-zoom.h"
+
+#include <math.h>
+
+guint
+ephy_zoom_get_zoom_level_index (float level)
+{
+	guint i;
+	float previous, current, mean;
+
+	previous = zoom_levels[0].level;
+
+	for (i = 1; i < n_zoom_levels; i++)
+	{
+		current = zoom_levels[i].level;
+		mean = sqrt (previous * current);
+
+		if (level <= mean) return i - 1;
+
+		previous = current;
+	}
+
+	return n_zoom_levels - 1;
+}
+
+
+float
+ephy_zoom_get_changed_zoom_level (float level, gint steps)
+{
+	guint index;
+
+	index = ephy_zoom_get_zoom_level_index (level);
+	return zoom_levels[CLAMP(index + steps, 0, n_zoom_levels - 1)].level;
+}
+
+float	ephy_zoom_get_nearest_zoom_level (float level)
+{
+	return ephy_zoom_get_changed_zoom_level (level, 0);
+}
--- epiphany-y/src/ephy-tab.c	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/src/ephy-tab.c	2003-05-18 14:26:26.000000000 +0200
@@ -404,7 +412,7 @@
 }
 
 static void
-ephy_tab_zoom_changed_cb (EphyEmbed *embed, gint zoom, EphyTab *tab)
+ephy_tab_zoom_changed_cb (EphyEmbed *embed, float zoom, EphyTab *tab)
 {
 	if (tab->priv->is_active)
 	{
--- epiphany-y/src/toolbar.h	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/src/toolbar.h	2003-05-13 20:09:46.000000000 +0200
@@ -73,6 +73,8 @@
 						 gboolean back,
 						 gboolean forward,
 						 gboolean up);
+void	      toolbar_update_zoom		(Toolbar *t,
+						 float zoom);
 
 void	      toolbar_set_visibility		(Toolbar *t,
 						 gboolean normal_toolbars,
--- epiphany-y/src/toolbar.c	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/src/toolbar.c	2003-05-18 11:31:57.000000000 +0200
@@ -35,6 +35,7 @@
 #include "ephy-go-action.h"
 #include "ephy-navigation-action.h"
 #include "ephy-bookmark-action.h"
+#include "ephy-zoom-action.h"
 #include "window-commands.h"
 #include "ephy-string.h"
 #include "ephy-debug.h"
@@ -126,6 +127,11 @@
 	ephy_embed_load_url (embed, location);
 }
 
+static void
+zoom_to_level_cb (EggAction *action, float zoom, EphyWindow *window)
+{
+	ephy_window_set_zoom (window, zoom);
+}
 
 static EggAction *
 ensure_bookmark_action (Toolbar *t, EphyBookmarks *bookmarks, gulong id, const char *action_name)
@@ -302,6 +308,16 @@
 	egg_action_group_add_action (t->priv->action_group, action);
 	g_object_unref (action);
 
+	action = g_object_new (EPHY_TYPE_ZOOM_ACTION,
+			       "name", "Zoom",
+			       "label", _("Zoom"),
+			       "zoom", 1.0,
+			       NULL);
+	g_signal_connect (action, "zoom_to_level",
+			  G_CALLBACK (zoom_to_level_cb), t->priv->window);
+	egg_action_group_add_action (t->priv->action_group, action);
+	g_object_unref (action);
+
 	action = g_object_new (EPHY_TYPE_FAVICON_ACTION,
 			       "name", "Favicon",
 			       "label", _("Favicon"),
@@ -754,3 +770,14 @@
 		}
 	}
 }
+
+void
+toolbar_update_zoom (Toolbar *t, float zoom)
+{
+	EggActionGroup *action_group;
+	EggAction *action;
+
+	action_group = t->priv->action_group;
+	action = egg_action_group_get_action (action_group, "Zoom");
+	g_object_set (action, "zoom", zoom, NULL);
+}
--- epiphany-y/src/ephy-window.h	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/src/ephy-window.h	2003-05-18 21:58:26.000000000 +0200
@@ -108,7 +108,7 @@
 						   const char *url);
 
 void		  ephy_window_set_zoom		  (EphyWindow *window,
-						   gint zoom);
+						   float zoom);
 
 void		  ephy_window_activate_location	  (EphyWindow *window);
 
--- epiphany-y/src/ephy-window.c	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/src/ephy-window.c	2003-05-19 17:12:32.000000000 +0200
@@ -30,6 +30,7 @@
 #include "ephy-shell.h"
 #include "eel-gconf-extensions.h"
 #include "ephy-prefs.h"
+#include "ephy-zoom.h"
 #include "ephy-debug.h"
 #include "ephy-file-helpers.h"
 #include "statusbar.h"
@@ -469,8 +471,6 @@
 	g_object_set (action, "short_label", _("Print"), NULL);
 	action = egg_action_group_get_action (action_group, "FileBookmarkPage");
 	g_object_set (action, "short_label", _("Bookmark"), NULL);
-	action = egg_action_group_get_action (action_group, "ViewZoomNormal");
-	g_object_set (action, "sensitive", FALSE, NULL);
 
 	action_group = egg_action_group_new ("PopupsActions");
 	egg_action_group_add_actions (action_group, ephy_popups_entries,
@@ -1094,6 +1105,40 @@
 }
 
 static void
+update_zoom_control (EphyWindow *window)
+{
+	EphyEmbed *embed;
+	EggActionGroup *action_group;
+	EggAction *action;
+	gboolean can_zoom_in = TRUE, can_zoom_out = TRUE, can_zoom_normal = FALSE;
+	float zoom = 1.0;
+	gresult rv;
+
+	g_return_if_fail (window != NULL);
+	
+	embed = ephy_window_get_active_embed (window);	
+	g_return_if_fail (embed != NULL);
+
+	rv = ephy_embed_zoom_get (embed, &zoom);
+	if (rv == G_OK)
+	{
+		if (zoom >= ZOOM_MAXIMAL) can_zoom_in = FALSE; 
+		if (zoom <= ZOOM_MINIMAL) can_zoom_out = FALSE; 
+		if (zoom != 1.0) can_zoom_normal = TRUE;
+	}
+
+	toolbar_update_zoom (window->priv->toolbar, zoom);
+
+	action_group = window->priv->action_group;
+	action = egg_action_group_get_action (action_group, "ViewZoomIn");
+	g_object_set (action, "sensitive", can_zoom_in, NULL);
+	action = egg_action_group_get_action (action_group, "ViewZoomOut");
+	g_object_set (action, "sensitive", can_zoom_out, NULL);
+	action = egg_action_group_get_action (action_group, "ViewZoomNormal");
+	g_object_set (action, "sensitive", can_zoom_normal, NULL);
+}
+
+static void
 update_title_control (EphyWindow *window)
 {
 	EphyTab *tab;
@@ -1247,6 +1292,7 @@
 		 /* the zoom control is updated at the same time than the navigation
 		    controls. This keeps it synched most of the time, but not always,
 		    because we don't get a notification when zoom changes */
+		update_zoom_control (window);
 	case NavControl:
 		update_nav_control (window);
 		break;
@@ -1290,6 +1336,7 @@
 		update_security (window);
 		update_find_control (window);
 		update_spinner_control (window);
+		update_zoom_control (window);
 	}
 }
 
@@ -1432,27 +1479,31 @@
 
 void
 ephy_window_set_zoom (EphyWindow *window,
-		      gint zoom)
+		      float zoom)
 {
 	EphyEmbed *embed;
-	gboolean zoom_out, zoom_normal;
-	EggActionGroup *action_group;
-	EggAction *action;
+	float current_zoom = 1.0;
 
         g_return_if_fail (IS_EPHY_WINDOW (window));
 
 	embed = ephy_window_get_active_embed (window);
         g_return_if_fail (embed != NULL);
 
-        ephy_embed_zoom_set (embed, zoom, TRUE);
+	ephy_embed_zoom_get (embed, &current_zoom);
 
-	zoom_normal = (zoom != 100);
-	zoom_out = (zoom > 0);
-	action_group = window->priv->action_group;
-	action = egg_action_group_get_action (action_group, "ViewZoomOut");
-	g_object_set (action, "sensitive", zoom_out, NULL);
-	action = egg_action_group_get_action (action_group, "ViewZoomNormal");
-	g_object_set (action, "sensitive", zoom_normal, NULL);
+	if (zoom == ZOOM_IN)
+	{
+		zoom = ephy_zoom_get_changed_zoom_level (current_zoom, 1);
+	}
+	else if (zoom == ZOOM_OUT)
+	{
+		zoom = ephy_zoom_get_changed_zoom_level (current_zoom, -1);
+	}
+
+	if (zoom != current_zoom)
+	{
+		ephy_embed_zoom_set (embed, zoom, TRUE);
+	}
 }
 
 Toolbar *
--- epiphany-y/src/window-commands.c	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/src/window-commands.c	2003-05-19 11:08:39.000000000 +0200
@@ -36,6 +36,7 @@
 #include "toolbar.h"
 #include "ephy-state.h"
 #include "ephy-gui.h"
+#include "ephy-zoom.h"
 
 #include <string.h>
 #include <libgnomevfs/gnome-vfs-uri.h>
@@ -565,38 +564,21 @@
 window_cmd_view_zoom_in	(EggAction *action,
 			 EphyWindow *window)
 {
-	EphyEmbed *embed;
-	int zoom;
-
-	embed = ephy_window_get_active_embed (window);
-	g_return_if_fail (embed != NULL);
-
-	ephy_embed_zoom_get (embed, &zoom);
-	ephy_window_set_zoom (window, zoom + 10);
+	ephy_window_set_zoom (window, ZOOM_IN);
 }
 
 void
 window_cmd_view_zoom_out (EggAction *action,
 			  EphyWindow *window)
 {
-	EphyEmbed *embed;
-	int zoom;
-
-	embed = ephy_window_get_active_embed (window);
-	g_return_if_fail (embed != NULL);
-
-	ephy_embed_zoom_get (embed, &zoom);
-	if (zoom >= 10)
-	{
-		ephy_window_set_zoom (window, zoom - 10);
-	}
+	ephy_window_set_zoom (window, ZOOM_OUT);
 }
 
 void
 window_cmd_view_zoom_normal (EggAction *action,
 			     EphyWindow *window)
 {
-	ephy_window_set_zoom (window, 100);
+	ephy_window_set_zoom (window, 1.0);
 }
 
 void
--- epiphany-y/src/ephy-nautilus-view.c	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/src/ephy-nautilus-view.c	2003-05-15 21:21:32.000000000 +0200
@@ -29,6 +29,7 @@
 #include "find-dialog.h"
 #include "print-dialog.h"
 #include "ephy-prefs.h"
+#include "ephy-zoom.h"
 #include "eel-gconf-extensions.h"
 #include "ephy-debug.h"
 
@@ -47,7 +48,7 @@
 								 EphyEmbedEvent *event,
 								 EphyNautilusView *view);
 static void		gnv_embed_zoom_change_cb 		(EphyNautilusView *embed,
-								 guint new_zoom, 
+								 float new_zoom, 
 								 EphyNautilusView *view);
 
 
@@ -97,34 +98,6 @@
 								 EphyEmbedPopup *popup, 
 								 const char* verbname);
 
-
-static float preferred_zoom_levels[] = {
-	0.2, 0.4, 0.6, 0.8,
-	1.0, 1.2, 1.4, 1.6, 1.8,
-	2.0, 2.2, 2.4, 2.6, 2.8,
-	3.0, 3.2, 3.4, 3.6, 3.8,
-	4.0, 4.2, 4.4, 4.6, 4.8,
-	5.0, 5.2, 5.4, 5.6, 5.8,
-	6.0, 6.2, 6.4, 6.6, 6.8,
-	7.0, 7.2, 7.4, 7.6, 7.8,
-	8.0, 8.2, 8.4, 8.6, 8.8,
-	9.0, 9.2, 9.4, 9.6, 9.8,
-};
-
-static const gchar *preferred_zoom_level_names[] = {
-	"20%", "40%", "60%", "80%",
-	"100%", "120%", "140%", "160%", "180%",
-	"200%", "220%", "240%", "260%", "280%",
-	"300%", "320%", "340%", "360%", "380%",
-	"400%", "420%", "440%", "460%", "480%",
-	"500%", "520%", "540%", "560%", "580%",
-	"600%", "620%", "640%", "660%", "680%",
-	"700%", "720%", "740%", "760%", "780%",
-	"800%", "820%", "840%", "860%", "880%",
-	"900%", "920%", "940%", "960%", "980%",
-};
-#define NUM_ZOOM_LEVELS (sizeof (preferred_zoom_levels) / sizeof (float))
-
 struct EphyNautilusViewPrivate {
 	EphyEmbed *embed;
 	char *title;
@@ -170,6 +143,9 @@
 	GtkWidget *w;
 	EphyNautilusViewPrivate *p = g_new0 (EphyNautilusViewPrivate, 1);
 	EphyEmbedSingle *single;
+	float *levels;
+	gchar **names;
+	guint i;
 
 	single = ephy_embed_shell_get_embed_single
 		(EPHY_EMBED_SHELL (ephy_shell));
@@ -250,14 +226,26 @@
 	bonobo_object_add_interface (BONOBO_OBJECT (view),
 				     BONOBO_OBJECT (view->priv->zoomable));
 
+	/* get zoom levels */
+	levels = g_new0 (float, n_zoom_levels);
+	names = g_new0 (gchar *, n_zoom_levels);
+	for (i = 0; i < n_zoom_levels; i++)
+	{
+		levels[i] = zoom_levels[i].level;
+		names[i] = zoom_levels[i].name;
+	}
+
 	bonobo_zoomable_set_parameters_full (view->priv->zoomable,
 					     1.0,
-					     preferred_zoom_levels [0],
-					     preferred_zoom_levels [NUM_ZOOM_LEVELS - 1],
+					     levels [0],
+					     levels [n_zoom_levels-1],
 					     FALSE, FALSE, TRUE,
-					     preferred_zoom_levels,
-					     preferred_zoom_level_names,
-					     NUM_ZOOM_LEVELS);
+					     levels,
+					     (const gchar **) names,
+					     n_zoom_levels);
+
+	g_free (levels);
+	g_free (names);
 
 	bonobo_object_add_interface (BONOBO_OBJECT (view),
 				     BONOBO_OBJECT (view->priv->zoomable));
@@ -613,33 +601,41 @@
 				float level,
 				EphyNautilusView *view)
 {
-	gint zoom = level * 100;
 	g_return_if_fail (EPHY_IS_NAUTILUS_VIEW (view));
-	if (zoom < 10) return;
-	if (zoom > 1000) return;
-	ephy_embed_zoom_set (view->priv->embed, zoom, TRUE);
+	ephy_embed_zoom_set (view->priv->embed,
+			     ephy_zoom_get_nearest_zoom_level (level), TRUE);
 }
 
 static void
 gnv_zoomable_zoom_in_cb (BonoboZoomable *zoomable,
 			 EphyNautilusView *view)
 {
-	gint zoom;
+	float zoom, new_zoom;
+	gresult rv;
+	
 	g_return_if_fail (EPHY_IS_NAUTILUS_VIEW (view));
-	ephy_embed_zoom_get (view->priv->embed, &zoom);
-	if (zoom > 990) return;
-	ephy_embed_zoom_set (view->priv->embed, zoom + 10, TRUE);
+
+	rv = ephy_embed_zoom_get (view->priv->embed, &zoom);
+	if (rv == G_FAILED) return;
+
+	new_zoom = ephy_zoom_get_changed_zoom_level (zoom, 1);
+	ephy_embed_zoom_set (view->priv->embed, new_zoom, TRUE);
 }
 
 static void
 gnv_zoomable_zoom_out_cb (BonoboZoomable *zoomable,
 			  EphyNautilusView *view)
 {
-	gint zoom;
+	float zoom, new_zoom;
+	gresult rv;
+		
 	g_return_if_fail (EPHY_IS_NAUTILUS_VIEW (view));
-	ephy_embed_zoom_get (view->priv->embed, &zoom);
-	if (zoom < 20) return;
-	ephy_embed_zoom_set (view->priv->embed, zoom - 10, TRUE);
+
+	rv = ephy_embed_zoom_get (view->priv->embed, &zoom);
+	if (rv == G_FAILED) return;
+
+	new_zoom = ephy_zoom_get_changed_zoom_level (zoom, -1);
+	ephy_embed_zoom_set (view->priv->embed, new_zoom, TRUE);
 }
 
 static void
@@ -654,22 +650,18 @@
 				 EphyNautilusView *view)
 {
 	g_return_if_fail (EPHY_IS_NAUTILUS_VIEW (view));
-	ephy_embed_zoom_set (view->priv->embed, 100, TRUE);
+	ephy_embed_zoom_set (view->priv->embed, 1.0, TRUE);
 }
 
 static void
 gnv_embed_zoom_change_cb (EphyNautilusView *embed,
-			  guint new_zoom, 
+			  float new_zoom, 
 			  EphyNautilusView *view)
 {
-	float flevel;
 	g_return_if_fail (EPHY_IS_NAUTILUS_VIEW (view));
 	
-	flevel = ((float) new_zoom) / 100.0;
-	
 	bonobo_zoomable_report_zoom_level_changed (view->priv->zoomable,
-						   flevel, NULL);
-	
+						   new_zoom, NULL);
 }
 
 
--- epiphany-y/embed/mozilla/mozilla-embed.cpp	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/embed/mozilla/mozilla-embed.cpp	2003-05-10 16:36:47.000000000 +0200
@@ -25,6 +25,7 @@
 #include "MozillaPrivate.h"
 #include "EphyWrapper.h"
 #include "EventContext.h"
+#include "ephy-debug.h"
 
 #include <nsIWindowWatcher.h>
 #include <nsIURI.h>
@@ -37,8 +38,6 @@
 #include <nsIPrintOptions.h>
 #include <nsGfxCIID.h>
 
-#include <math.h>
-
 static void
 mozilla_embed_class_init (MozillaEmbedClass *klass);
 static void
@@ -104,11 +103,11 @@
 		EmbedDisplayType display_type);
 static gresult
 impl_zoom_set (EphyEmbed *embed, 
-               int zoom, 
+               float zoom, 
                gboolean reflow);
 static gresult
 impl_zoom_get (EphyEmbed *embed,
-               int *zoom);
+               float *zoom);
 static gresult 
 impl_selection_can_cut (EphyEmbed *embed);
 static gresult 
@@ -772,7 +771,7 @@
 
 static gresult
 impl_zoom_set (EphyEmbed *embed, 
-               int zoom, 
+               float zoom, 
                gboolean reflow)
 {
 	EphyWrapper *wrapper;
@@ -781,7 +780,7 @@
 	wrapper = MOZILLA_EMBED(embed)->priv->wrapper;
 	g_return_val_if_fail (wrapper != NULL, G_FAILED);
 
-	result = wrapper->SetZoom ((float)(zoom) / 100, reflow);
+	result = wrapper->SetZoom (zoom, reflow);
 
 	if (NS_SUCCEEDED (result))
 	{
@@ -793,7 +792,7 @@
 
 static gresult
 impl_zoom_get (EphyEmbed *embed,
-               int *zoom)
+               float *zoom)
 {
 	float f;
 	EphyWrapper *wrapper;
@@ -801,15 +800,17 @@
 	wrapper = MOZILLA_EMBED(embed)->priv->wrapper;
 	if (!wrapper)
 	{
-		*zoom = 100;
-		return G_OK;
+		LOG ("impl_zoom_get: wrapper == NULL")
+		
+		*zoom = 1.0;
+		return G_FAILED;
 	}
 	
 	nsresult result = wrapper->GetZoom (&f);
 	
 	if (NS_SUCCEEDED (result))
 	{
-		*zoom = (int) rint (f * 100);
+		*zoom = f;
 
 		return G_OK;
 	}
--- epiphany-y/embed/ephy-embed.h	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/embed/ephy-embed.h	2003-04-24 19:38:15.000000000 +0200
@@ -235,10 +235,10 @@
 					    EphyEmbed *source,
 					    EmbedDisplayType display_type);
 	gresult   (* zoom_set)             (EphyEmbed *embed,
-					    int zoom,
+					    float zoom,
 					    gboolean reflow);
 	gresult   (* zoom_get)             (EphyEmbed *embed,
-				            int *zoom);
+				            float *zoom);
 	gresult   (* selection_can_cut)    (EphyEmbed *embed);
 	gresult   (* selection_can_copy)   (EphyEmbed *embed);
 	gresult   (* can_paste)            (EphyEmbed *embed);
@@ -337,11 +337,11 @@
 
 /* Zoom */
 gresult       ephy_embed_zoom_set             (EphyEmbed *embed,
-					       int zoom,
+					       float zoom,
 					       gboolean reflow);
 
 gresult       ephy_embed_zoom_get             (EphyEmbed *embed,
-					       int *zoom);
+					       float *zoom);
 
 /* Clipboard */
 gresult       ephy_embed_selection_can_cut    (EphyEmbed *embed);
--- epiphany-y/embed/ephy-embed.c	2003-05-19 11:08:15.000000000 +0200
+++ epiphany-build/embed/ephy-embed.c	2003-04-26 13:45:53.000000000 +0200
@@ -245,10 +245,10 @@
                               G_SIGNAL_RUN_LAST,
                               G_STRUCT_OFFSET (EphyEmbedClass, zoom_change),
                               NULL, NULL,
-                              g_cclosure_marshal_VOID__INT,
+                              g_cclosure_marshal_VOID__FLOAT,
                               G_TYPE_NONE,
                               1,
-			      G_TYPE_INT);
+			      G_TYPE_FLOAT);
 	initialized = TRUE;
 	}
 }
@@ -411,7 +411,7 @@
 
 gresult
 ephy_embed_zoom_set (EphyEmbed *embed,
-                     int zoom,
+                     float zoom,
                      gboolean reflow)
 {
 	EphyEmbedClass *klass = EPHY_EMBED_GET_CLASS (embed);
@@ -420,7 +420,7 @@
 
 gresult
 ephy_embed_zoom_get (EphyEmbed *embed,
-                     int *zoom)
+                     float *zoom)
 {
 	EphyEmbedClass *klass = EPHY_EMBED_GET_CLASS (embed);
         return klass->zoom_get (embed, zoom);
