From: Alexander Butenko Date: Fri, 25 Jun 2010 13:50:19 +0000 (-0400) Subject: Merge _action_zoom_*_activate into _action_zoom_activate () X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b55b7ab7bbe37112e45a7bbb81abf2abb3fd07b;p=midori Merge _action_zoom_*_activate into _action_zoom_activate () --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 958da3cb..9788bd54 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, "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, "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, "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"), "U",