tazweb rev 60
Let have zoom functions! (menu item, search, download, zoom = binary at 20Kb :-)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Apr 22 04:15:49 2011 +0200 (2011-04-22) |
parents | 1073112f24ce |
children | 1b31bef08447 |
files | src/main.c |
line diff
1.1 --- a/src/main.c Fri Apr 22 03:49:58 2011 +0200 1.2 +++ b/src/main.c Fri Apr 22 04:15:49 2011 +0200 1.3 @@ -163,6 +163,19 @@ 1.4 system (buffer); 1.5 } 1.6 1.7 +/* Zoom ou and in callback function */ 1.8 +static void 1.9 +zoom_out_cb (GtkWidget *main_window) 1.10 +{ 1.11 + webkit_web_view_zoom_out (web_view); 1.12 +} 1.13 + 1.14 +static void 1.15 +zoom_in_cb (GtkWidget *main_window) 1.16 +{ 1.17 + webkit_web_view_zoom_in (web_view); 1.18 +} 1.19 + 1.20 /* Add items to WebKit contextual menu */ 1.21 static void 1.22 populate_menu_cb (WebKitWebView *web_view, GtkMenu *menu, gpointer data) 1.23 @@ -173,6 +186,24 @@ 1.24 item = gtk_separator_menu_item_new (); 1.25 gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); 1.26 1.27 + /* Zoom in */ 1.28 + item = gtk_image_menu_item_new_with_label ("Zoom in"); 1.29 + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), 1.30 + gtk_image_new_from_stock (GTK_STOCK_ZOOM_IN, GTK_ICON_SIZE_MENU)); 1.31 + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); 1.32 + g_signal_connect (item, "activate", G_CALLBACK (zoom_in_cb), NULL); 1.33 + 1.34 + /* Zoom out */ 1.35 + item = gtk_image_menu_item_new_with_label ("Zoom out"); 1.36 + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), 1.37 + gtk_image_new_from_stock (GTK_STOCK_ZOOM_OUT, GTK_ICON_SIZE_MENU)); 1.38 + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); 1.39 + g_signal_connect (item, "activate", G_CALLBACK (zoom_out_cb), NULL); 1.40 + 1.41 + /* separator */ 1.42 + item = gtk_separator_menu_item_new (); 1.43 + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); 1.44 + 1.45 /* TazWeb documentation */ 1.46 item = gtk_image_menu_item_new_with_label ("TazWeb manual"); 1.47 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item),