diff options
author | Alp Toker <atoker@src.gnome.org> | 2008-06-17 20:14:38 +0800 |
---|---|---|
committer | Alp Toker <atoker@src.gnome.org> | 2008-06-17 20:14:38 +0800 |
commit | 56a66d5199051672a5887c0120a86f14a463dba7 (patch) | |
tree | de646d1f9e5b8829022e8f0e749bf9ab00d93617 /embed | |
parent | 4adbd86dc2be3a90d57fed5c3bfc0a71305ba0e0 (diff) | |
download | gsoc2013-epiphany-56a66d5199051672a5887c0120a86f14a463dba7.tar gsoc2013-epiphany-56a66d5199051672a5887c0120a86f14a463dba7.tar.gz gsoc2013-epiphany-56a66d5199051672a5887c0120a86f14a463dba7.tar.bz2 gsoc2013-epiphany-56a66d5199051672a5887c0120a86f14a463dba7.tar.lz gsoc2013-epiphany-56a66d5199051672a5887c0120a86f14a463dba7.tar.xz gsoc2013-epiphany-56a66d5199051672a5887c0120a86f14a463dba7.tar.zst gsoc2013-epiphany-56a66d5199051672a5887c0120a86f14a463dba7.zip |
Emit zoom change signal and implement pixel scrolling
svn path=/trunk/; revision=8282
Diffstat (limited to 'embed')
-rw-r--r-- | embed/webkit/webkit-embed.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/embed/webkit/webkit-embed.c b/embed/webkit/webkit-embed.c index f902d9a76..f5d622fee 100644 --- a/embed/webkit/webkit-embed.c +++ b/embed/webkit/webkit-embed.c @@ -65,6 +65,7 @@ typedef enum struct WebKitEmbedPrivate { WebKitWebView *web_view; + GtkScrolledWindow *scrolled_window; WebKitEmbedLoadState load_state; char *loading_uri; EphyHistory *history; @@ -298,6 +299,7 @@ webkit_embed_init (WebKitEmbed *embed) embed->priv = WEBKIT_EMBED_GET_PRIVATE (embed); sw = gtk_scrolled_window_new (NULL, NULL); + embed->priv->scrolled_window = GTK_SCROLLED_WINDOW (sw); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -443,7 +445,10 @@ static void impl_set_zoom (EphyEmbed *embed, float zoom) { + g_return_if_fail (zoom > 0.0); + g_object_set (WEBKIT_EMBED (embed)->priv->web_view, "zoom-level", zoom, NULL); + g_signal_emit_by_name (embed, "ge_zoom_change", zoom); } static void @@ -463,6 +468,18 @@ impl_scroll_pixels (EphyEmbed *embed, int dx, int dy) { + GtkAdjustment *hadj; + GtkAdjustment *vadj; + WebKitEmbed *wembed = WEBKIT_EMBED (embed); + + hadj = gtk_scrolled_window_get_hadjustment (wembed->priv->scrolled_window); + vadj = gtk_scrolled_window_get_vadjustment (wembed->priv->scrolled_window); + + hadj->value += dx; + vadj->value += dy; + + gtk_adjustment_value_changed (hadj); + gtk_adjustment_value_changed (vadj); } static void |