aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-12-13 01:53:44 +0800
committerXan Lopez <xan@igalia.com>2012-12-13 01:53:44 +0800
commit1e584013e5f23a1b25dcc59a58897cfdca66b32d (patch)
tree458d8352ad7a2ecf97648560b5c9c201f0091271
parent7b9cae2a19210d191270ad9386a45a0dfe77216d (diff)
downloadgsoc2013-epiphany-1e584013e5f23a1b25dcc59a58897cfdca66b32d.tar
gsoc2013-epiphany-1e584013e5f23a1b25dcc59a58897cfdca66b32d.tar.gz
gsoc2013-epiphany-1e584013e5f23a1b25dcc59a58897cfdca66b32d.tar.bz2
gsoc2013-epiphany-1e584013e5f23a1b25dcc59a58897cfdca66b32d.tar.lz
gsoc2013-epiphany-1e584013e5f23a1b25dcc59a58897cfdca66b32d.tar.xz
gsoc2013-epiphany-1e584013e5f23a1b25dcc59a58897cfdca66b32d.tar.zst
gsoc2013-epiphany-1e584013e5f23a1b25dcc59a58897cfdca66b32d.zip
ephy-window: we can actually zoom images now, so allow that
-rw-r--r--src/ephy-window.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 7d798d1ac..76b9b8e64 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1477,25 +1477,12 @@ sync_tab_address (EphyWebView *view,
}
static void
-_ephy_window_action_set_zoom (EphyWindow *window,
- gboolean can_zoom,
- float zoom)
-{
- EphyWindowPrivate *priv = window->priv;
- GtkAction *action = gtk_action_group_get_action (priv->toolbar_action_group,
- "Zoom");
-
- gtk_action_set_sensitive (action, can_zoom);
- g_object_set (action, "zoom", can_zoom ? zoom : 1.0, NULL);
-}
-
-static void
sync_tab_zoom (WebKitWebView *web_view, GParamSpec *pspec, EphyWindow *window)
{
GtkActionGroup *action_group;
GtkAction *action;
EphyWebViewDocumentType type;
- gboolean can_zoom_in = TRUE, can_zoom_out = TRUE, can_zoom_normal = FALSE, can_zoom;
+ gboolean can_zoom_in = TRUE, can_zoom_out = TRUE, can_zoom_normal = FALSE;
double zoom;
EphyEmbed *embed = window->priv->active_embed;
@@ -1503,31 +1490,28 @@ sync_tab_zoom (WebKitWebView *web_view, GParamSpec *pspec, EphyWindow *window)
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);
-
if (zoom >= ZOOM_MAXIMAL)
{
can_zoom_in = FALSE;
}
+
if (zoom <= ZOOM_MINIMAL)
{
can_zoom_out = FALSE;
}
+
if (zoom != 1.0)
{
can_zoom_normal = TRUE;
}
- _ephy_window_action_set_zoom (window, can_zoom, zoom);
-
action_group = window->priv->action_group;
action = gtk_action_group_get_action (action_group, "ViewZoomIn");
- gtk_action_set_sensitive (action, can_zoom_in && can_zoom);
+ gtk_action_set_sensitive (action, can_zoom_in);
action = gtk_action_group_get_action (action_group, "ViewZoomOut");
- gtk_action_set_sensitive (action, can_zoom_out && can_zoom);
+ gtk_action_set_sensitive (action, can_zoom_out);
action = gtk_action_group_get_action (action_group, "ViewZoomNormal");
- gtk_action_set_sensitive (action, can_zoom_normal && can_zoom);
+ gtk_action_set_sensitive (action, can_zoom_normal);
}
static void