Merge _action_zoom_*_activate into _action_zoom_activate ()

This commit is contained in:
Alexander Butenko 2010-06-25 09:50:19 -04:00 committed by Christian Dywan
parent b2d0d0af8e
commit 3b55b7ab7b

View file

@ -3232,31 +3232,20 @@ _action_reload_stop_activate (GtkAction* action,
} }
static void static void
_action_zoom_in_activate (GtkAction* action, _action_zoom_activate (GtkAction* action,
MidoriBrowser* browser) MidoriBrowser* browser)
{ {
GtkWidget* view = midori_browser_get_current_tab (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_set_zoom_level (MIDORI_VIEW (view),
midori_view_get_zoom_level (MIDORI_VIEW (view)) + 0.25f); midori_view_get_zoom_level (MIDORI_VIEW (view)) + 0.25f);
} else if (g_str_equal (gtk_action_get_name (action), "ZoomOut"))
static void
_action_zoom_out_activate (GtkAction* action,
MidoriBrowser* browser)
{
GtkWidget* view = midori_browser_get_current_tab (browser);
if (view)
midori_view_set_zoom_level (MIDORI_VIEW (view), midori_view_set_zoom_level (MIDORI_VIEW (view),
midori_view_get_zoom_level (MIDORI_VIEW (view)) - 0.25f); midori_view_get_zoom_level (MIDORI_VIEW (view)) - 0.25f);
} else
static void
_action_zoom_normal_activate (GtkAction* action,
MidoriBrowser* browser)
{
GtkWidget* view = midori_browser_get_current_tab (browser);
if (view)
midori_view_set_zoom_level (MIDORI_VIEW (view), 1.0f); 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) }, N_("Reload the current page"), G_CALLBACK (_action_reload_stop_activate) },
{ "ZoomIn", GTK_STOCK_ZOOM_IN, { "ZoomIn", GTK_STOCK_ZOOM_IN,
NULL, "<Ctrl>plus", 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, { "ZoomOut", GTK_STOCK_ZOOM_OUT,
NULL, "<Ctrl>minus", 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, { "ZoomNormal", GTK_STOCK_ZOOM_100,
NULL, "<Ctrl>0", 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") }, { "Encoding", NULL, N_("_Encoding") },
{ "SourceView", NULL, { "SourceView", NULL,
N_("View So_urce"), "<Ctrl><Alt>U", N_("View So_urce"), "<Ctrl><Alt>U",