diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2012-06-21 18:24:15 +0800 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-06-21 18:45:21 +0800 |
commit | 32c03a55b26a95bebfbde11a167c4f563070d024 (patch) | |
tree | 094687d6890e11e13c56a461976c7dee30aea6bb /src | |
parent | 4d265094c5d28e7192dec077ea56c2a6c199cb4a (diff) | |
download | gsoc2013-epiphany-32c03a55b26a95bebfbde11a167c4f563070d024.tar.gz gsoc2013-epiphany-32c03a55b26a95bebfbde11a167c4f563070d024.tar.zst gsoc2013-epiphany-32c03a55b26a95bebfbde11a167c4f563070d024.zip |
Use WebKitWebView API to get/set the zoom level instead of g_object_get/set
Also use always double instead of float so that it will be compatible
with WebKit2 API.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-window.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index 292e958d0..544ff5960 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1410,14 +1410,12 @@ sync_tab_zoom (WebKitWebView *web_view, GParamSpec *pspec, EphyWindow *window) GtkAction *action; EphyWebViewDocumentType type; gboolean can_zoom_in = TRUE, can_zoom_out = TRUE, can_zoom_normal = FALSE, can_zoom; - float zoom; + double zoom; EphyEmbed *embed = window->priv->active_embed; if (window->priv->closing) return; - g_object_get (web_view, - "zoom-level", &zoom, - NULL); + zoom = webkit_web_view_get_zoom_level (web_view); type = ephy_web_view_get_document_type (ephy_embed_get_web_view (embed)); can_zoom = (type != EPHY_WEB_VIEW_DOCUMENT_IMAGE); @@ -3636,7 +3634,7 @@ ephy_window_set_zoom (EphyWindow *window, float zoom) { EphyEmbed *embed; - float current_zoom = 1.0; + double current_zoom = 1.0; WebKitWebView *web_view; g_return_if_fail (EPHY_IS_WINDOW (window)); @@ -3646,7 +3644,7 @@ ephy_window_set_zoom (EphyWindow *window, web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed); - g_object_get (web_view, "zoom-level", ¤t_zoom, NULL); + current_zoom = webkit_web_view_get_zoom_level (web_view); if (zoom == ZOOM_IN) { @@ -3659,7 +3657,7 @@ ephy_window_set_zoom (EphyWindow *window, if (zoom != current_zoom) { - g_object_set (G_OBJECT (web_view), "zoom-level", zoom, NULL); + webkit_web_view_set_zoom_level (web_view, zoom); } } |