aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2008-07-01 05:27:12 +0800
committerXan Lopez <xan@src.gnome.org>2008-07-01 05:27:12 +0800
commit76dd77e2f40b6e2de50716117c3abd2c49e528a4 (patch)
tree7d5d70b1896bd02fe42715dccfbc5ad7fd0d25b9 /src/ephy-window.c
parent751d86d728c53a39887036e8e85ab4b8600ec60d (diff)
downloadgsoc2013-epiphany-76dd77e2f40b6e2de50716117c3abd2c49e528a4.tar
gsoc2013-epiphany-76dd77e2f40b6e2de50716117c3abd2c49e528a4.tar.gz
gsoc2013-epiphany-76dd77e2f40b6e2de50716117c3abd2c49e528a4.tar.bz2
gsoc2013-epiphany-76dd77e2f40b6e2de50716117c3abd2c49e528a4.tar.lz
gsoc2013-epiphany-76dd77e2f40b6e2de50716117c3abd2c49e528a4.tar.xz
gsoc2013-epiphany-76dd77e2f40b6e2de50716117c3abd2c49e528a4.tar.zst
gsoc2013-epiphany-76dd77e2f40b6e2de50716117c3abd2c49e528a4.zip
embed: remove ge-zoom-changed and zoom property.
Use zoom-level property in WebKit directly. svn path=/trunk/; revision=8326
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 51b9f6895..52c19603c 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -102,7 +102,7 @@ static void sync_tab_load_status (EphyEmbed *embed,
static void sync_tab_security (EphyEmbed *embed,
GParamSpec *pspec,
EphyWindow *window);
-static void sync_tab_zoom (EphyEmbed *embed,
+static void sync_tab_zoom (WebKitWebView *web_view,
GParamSpec *pspec,
EphyWindow *window);
@@ -1544,7 +1544,7 @@ sync_tab_document_type (EphyEmbed *embed,
if (priv->closing) return;
/* update zoom actions */
- sync_tab_zoom (embed, NULL, window);
+ sync_tab_zoom (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed), NULL, window);
type = ephy_embed_get_document_type (embed);
can_find = (type != EPHY_EMBED_DOCUMENT_IMAGE);
@@ -1854,17 +1854,21 @@ sync_tab_title (EphyEmbed *embed,
}
static void
-sync_tab_zoom (EphyEmbed *embed, GParamSpec *pspec, EphyWindow *window)
+sync_tab_zoom (WebKitWebView *web_view, GParamSpec *pspec, EphyWindow *window)
{
GtkActionGroup *action_group;
GtkAction *action;
EphyEmbedDocumentType type;
gboolean can_zoom_in = TRUE, can_zoom_out = TRUE, can_zoom_normal = FALSE, can_zoom;
float zoom;
+ EphyEmbed *embed = window->priv->active_embed;
if (window->priv->closing) return;
- zoom = ephy_embed_get_zoom (embed);
+ g_object_get (G_OBJECT (web_view),
+ "zoom-level", &zoom,
+ NULL);
+
type = ephy_embed_get_document_type (embed);
can_zoom = (type != EPHY_EMBED_DOCUMENT_IMAGE);
@@ -2401,7 +2405,14 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
if (old_embed != NULL)
{
+ WebKitWebView *web_view;
+
embed = old_embed;
+ web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
+
+ g_signal_handlers_disconnect_by_func (web_view,
+ G_CALLBACK (sync_tab_zoom),
+ window);
g_signal_handlers_disconnect_by_func (embed,
G_CALLBACK (sync_tab_popup_windows),
@@ -2416,9 +2427,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
G_CALLBACK (sync_tab_document_type),
window);
g_signal_handlers_disconnect_by_func (embed,
- G_CALLBACK (sync_tab_zoom),
- window);
- g_signal_handlers_disconnect_by_func (embed,
G_CALLBACK (sync_tab_load_progress),
window);
g_signal_handlers_disconnect_by_func (embed,
@@ -2454,11 +2462,12 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
if (new_embed != NULL)
{
+ WebKitWebView *web_view;
+
embed = new_embed;
sync_tab_security (embed, NULL, window);
sync_tab_document_type (embed, NULL, window);
- sync_tab_zoom (embed, NULL, window);
sync_tab_load_progress (embed, NULL, window);
sync_tab_load_status (embed, NULL, window);
sync_tab_navigation (embed, NULL, window);
@@ -2469,6 +2478,14 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
sync_tab_popup_windows (embed, NULL, window);
sync_tab_popups_allowed (embed, NULL, window);
+ web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
+
+ sync_tab_zoom (web_view, NULL, window);
+
+ g_signal_connect_object (web_view, "notify::zoom-level",
+ G_CALLBACK (sync_tab_zoom),
+ window, 0);
+
g_signal_connect_object (embed, "notify::hidden-popup-count",
G_CALLBACK (sync_tab_popup_windows),
window, 0);
@@ -2493,9 +2510,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
g_signal_connect_object (embed, "notify::document-type",
G_CALLBACK (sync_tab_document_type),
window, 0);
- g_signal_connect_object (embed, "notify::zoom",
- G_CALLBACK (sync_tab_zoom),
- window, 0);
g_signal_connect_object (embed, "notify::load-status",
G_CALLBACK (sync_tab_load_status),
window, 0);