[Xfce4-commits] <midori:master> Merge _action_zoom_*_activate into _action_zoom_activate ()

Christian Dywan noreply at xfce.org
Sat Jun 26 17:54:01 CEST 2010


Updating branch refs/heads/master
         to 3b55b7ab7bbe37112e45a7bbb81abf2abb3fd07b (commit)
       from b2d0d0af8ec2be672631d6acaed680a9958d9bea (commit)

commit 3b55b7ab7bbe37112e45a7bbb81abf2abb3fd07b
Author: Alexander Butenko <a.butenka at gmail.com>
Date:   Fri Jun 25 09:50:19 2010 -0400

    Merge _action_zoom_*_activate into _action_zoom_activate ()

 midori/midori-browser.c |   33 +++++++++++----------------------
 1 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 958da3c..9788bd5 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -3232,31 +3232,20 @@ _action_reload_stop_activate (GtkAction*     action,
 }
 
 static void
-_action_zoom_in_activate (GtkAction*     action,
-                          MidoriBrowser* browser)
+_action_zoom_activate (GtkAction*     action,
+                       MidoriBrowser* browser)
 {
     GtkWidget* view = midori_browser_get_current_tab (browser);
-    if (view)
+    if (!view)
+        return;
+
+    if (g_str_equal (gtk_action_get_name (action), "ZoomIn"))
         midori_view_set_zoom_level (MIDORI_VIEW (view),
             midori_view_get_zoom_level (MIDORI_VIEW (view)) + 0.25f);
-}
-
-static void
-_action_zoom_out_activate (GtkAction*     action,
-                           MidoriBrowser* browser)
-{
-    GtkWidget* view = midori_browser_get_current_tab (browser);
-    if (view)
+    else if (g_str_equal (gtk_action_get_name (action), "ZoomOut"))
         midori_view_set_zoom_level (MIDORI_VIEW (view),
             midori_view_get_zoom_level (MIDORI_VIEW (view)) - 0.25f);
-}
-
-static void
-_action_zoom_normal_activate (GtkAction*     action,
-                              MidoriBrowser* browser)
-{
-    GtkWidget* view = midori_browser_get_current_tab (browser);
-    if (view)
+    else
         midori_view_set_zoom_level (MIDORI_VIEW (view), 1.0f);
 }
 
@@ -5195,13 +5184,13 @@ static const GtkActionEntry entries[] =
         N_("Reload the current page"), G_CALLBACK (_action_reload_stop_activate) },
     { "ZoomIn", GTK_STOCK_ZOOM_IN,
         NULL, "<Ctrl>plus",
-        N_("Increase the zoom level"), G_CALLBACK (_action_zoom_in_activate) },
+        N_("Increase the zoom level"), G_CALLBACK (_action_zoom_activate) },
     { "ZoomOut", GTK_STOCK_ZOOM_OUT,
         NULL, "<Ctrl>minus",
-        N_("Decrease the zoom level"), G_CALLBACK (_action_zoom_out_activate) },
+        N_("Decrease the zoom level"), G_CALLBACK (_action_zoom_activate) },
     { "ZoomNormal", GTK_STOCK_ZOOM_100,
         NULL, "<Ctrl>0",
-        N_("Reset the zoom level"), G_CALLBACK (_action_zoom_normal_activate) },
+        N_("Reset the zoom level"), G_CALLBACK (_action_zoom_activate) },
     { "Encoding", NULL, N_("_Encoding") },
     { "SourceView", NULL,
         N_("View So_urce"), "<Ctrl><Alt>U",



More information about the Xfce4-commits mailing list