]> spindle.queued.net Git - midori/commitdiff
Toggle ZoomReset as the zoom level changes
authorChristian Dywan <christian@twotoasts.de>
Mon, 21 Jul 2008 23:51:08 +0000 (01:51 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 21 Jul 2008 23:51:08 +0000 (01:51 +0200)
midori/midori-browser.c

index 737b27d9a78a10f70b469c19320c9a75983940ac..7568f018348a3d6ad847d5b0d1dc627fd87e42f6 100644 (file)
@@ -429,6 +429,16 @@ midori_web_view_notify_title_cb (GtkWidget*     web_view,
     }
 }
 
+static void
+midori_web_view_notify_zoom_level_cb (GtkWidget*     web_view,
+                                      GParamSpec*    pspec,
+                                      MidoriBrowser* browser)
+{
+    if (web_view == midori_browser_get_current_web_view (browser))
+        _action_set_sensitive (browser, "ZoomNormal",
+            webkit_web_view_get_zoom_level (WEBKIT_WEB_VIEW (web_view)) != 1.0);
+}
+
 static void
 midori_web_view_statusbar_text_changed_cb (MidoriWebView*  web_view,
                                            const gchar*    text,
@@ -952,6 +962,8 @@ _midori_browser_add_tab (MidoriBrowser* browser,
                           midori_web_view_load_done_cb, browser,
                           "signal::notify::title",
                           midori_web_view_notify_title_cb, browser,
+                          "signal::notify::zoom-level",
+                          midori_web_view_notify_zoom_level_cb, browser,
                           "signal::status-bar-text-changed",
                           midori_web_view_statusbar_text_changed_cb, browser,
                           "signal::element-motion",