aboutsummaryrefslogtreecommitdiffstats
path: root/src/toolbar.c
diff options
context:
space:
mode:
authorChristian Persch <chpe+gnomebugz@stud.uni-saarland.de>2003-05-20 19:46:28 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-20 19:46:28 +0800
commit754c3261279b58118b16cfe9018613f058b59c9b (patch)
treed23770eeefb5b947ee44a27fc3cbad04f026de86 /src/toolbar.c
parentbc555495c56dc8836db5ac7a4f3f6b5772e315d6 (diff)
downloadgsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.gz
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.bz2
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.lz
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.xz
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.zst
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.zip
Simplified and reorganised zoom. Implement a zoom control for the toolbar.
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.
Diffstat (limited to 'src/toolbar.c')
-rwxr-xr-xsrc/toolbar.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/toolbar.c b/src/toolbar.c
index 728f81daf..d211de6d5 100755
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -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 @@ go_location_cb (EggAction *action, char *location, EphyWindow *window)
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 @@ toolbar_setup_actions (Toolbar *t)
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 @@ toolbar_set_visibility (Toolbar *t,
}
}
}
+
+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);
+}