From: Christian Dywan Date: Sun, 29 Nov 2009 14:09:00 +0000 (+0100) Subject: Enable Zoom and Fullscreen with hardware keys on Hildon X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2973df0f9b76cac74cd516b05c62f802c2631272;p=midori Enable Zoom and Fullscreen with hardware keys on Hildon --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index f8a0ddf1..de1f0e67 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -46,6 +46,8 @@ "sender='" MCE_SERVICE "'," \ "path='" MCE_SIGNAL_PATH "'," \ "interface='" MCE_SIGNAL_IF "'" + #include + #include #endif struct _MidoriBrowser @@ -4923,10 +4925,18 @@ static const GtkActionEntry entries[] = { NULL, "r", N_("Reload the current page"), G_CALLBACK (_action_reload_stop_activate) }, { "ZoomIn", GTK_STOCK_ZOOM_IN, + #if HAVE_HILDON + NULL, "F7", + #else NULL, "plus", + #endif N_("Increase the zoom level"), G_CALLBACK (_action_zoom_in_activate) }, { "ZoomOut", GTK_STOCK_ZOOM_OUT, + #if HAVE_HILDON + NULL, "F8", + #else NULL, "minus", + #endif N_("Decrease the zoom level"), G_CALLBACK (_action_zoom_out_activate) }, { "ZoomNormal", GTK_STOCK_ZOOM_100, NULL, "0", @@ -4940,7 +4950,11 @@ static const GtkActionEntry entries[] = { N_("View the source code of the selection"), NULL/*G_CALLBACK (_action_selection_source_view_activate)*/ }, { "Fullscreen", GTK_STOCK_FULLSCREEN, + #if HAVE_HILDON + NULL, "F6", + #else NULL, "F11", + #endif N_("Toggle fullscreen view"), G_CALLBACK (_action_fullscreen_activate) }, { "Go", NULL, N_("_Go") }, @@ -5281,6 +5295,15 @@ midori_browser_realize_cb (GtkStyle* style, { GdkScreen* screen; GtkIconTheme* icon_theme; + #ifdef HAVE_HILDON_2_2 + /* hildon_gtk_window_enable_zoom_keys */ + guint32 set = 1; + gdk_property_change (GTK_WIDGET (browser)->window, + gdk_atom_intern ("_HILDON_ZOOM_KEY_ATOM", FALSE), + gdk_x11_xatom_to_atom (XA_INTEGER), + 32, GDK_PROP_MODE_REPLACE, + (const guchar *) &set, 1); + #endif screen = gtk_widget_get_screen (GTK_WIDGET (browser)); if (screen)