tazweb rev 69

Restore back and forward button (now we have put some item to context menu) and make all thet look nice
author Christophe Lincoln <pankso@slitaz.org>
date Fri Apr 22 22:06:47 2011 +0200 (2011-04-22)
parents 434eb15b461b
children ad9308f7dbc4
files README src/main.c
line diff
     1.1 --- a/README	Fri Apr 22 19:29:12 2011 +0200
     1.2 +++ b/README	Fri Apr 22 22:06:47 2011 +0200
     1.3 @@ -47,7 +47,7 @@
     1.4                          G_CALLBACK (mime_type_decision_cb), web_view);
     1.5  
     1.6      * Get user config directory path in $HOME
     1.7 -      config = g_strdup_printf ("%s/.config/tazweb", g_get_home_dir ());
     1.8 +      config = g_strdup_printf ("%s/.config/tazweb", g_get_home_dir ());      
     1.9  
    1.10  
    1.11  ================================================================================
     2.1 --- a/src/main.c	Fri Apr 22 19:29:12 2011 +0200
     2.2 +++ b/src/main.c	Fri Apr 22 22:06:47 2011 +0200
     2.3 @@ -170,6 +170,19 @@
     2.4  	webkit_web_view_load_uri (web_view, uri);
     2.5  }
     2.6  
     2.7 +/* Navigation button function */
     2.8 +static void
     2.9 +go_back_cb (GtkWidget* widget, gpointer data)
    2.10 +{
    2.11 +    webkit_web_view_go_back (web_view);
    2.12 +}
    2.13 +
    2.14 +static void
    2.15 +go_forward_cb (GtkWidget* widget, gpointer data)
    2.16 +{
    2.17 +    webkit_web_view_go_forward (web_view);
    2.18 +}
    2.19 +
    2.20  /* Fullscreen and unfullscreen callback function */
    2.21  static void
    2.22  fullscreen_cb (GtkWindow* window, gpointer data)
    2.23 @@ -318,11 +331,14 @@
    2.24  	GtkToolItem* item;
    2.25  
    2.26  	toolbar = gtk_toolbar_new ();
    2.27 -	gtk_widget_set_size_request (toolbar, 0, 33);
    2.28 +	gtk_widget_set_size_request (toolbar, 0, 31);
    2.29  	gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar),
    2.30  			GTK_ORIENTATION_HORIZONTAL);
    2.31  	gtk_toolbar_set_style (GTK_TOOLBAR (toolbar),
    2.32  			GTK_TOOLBAR_BOTH_HORIZ);
    2.33 +	GdkColor bg;
    2.34 +	gdk_color_parse ("#f1efeb", &bg);
    2.35 +	gtk_widget_modify_bg (toolbar, GTK_STATE_NORMAL, &bg);
    2.36  
    2.37  	/* Home button */
    2.38  	item = gtk_tool_button_new_from_stock (GTK_STOCK_HOME);
    2.39 @@ -330,10 +346,26 @@
    2.40  			G_CALLBACK (go_home_cb), NULL);
    2.41  	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
    2.42  
    2.43 +	/* The back button */
    2.44 +    item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK);
    2.45 +    g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_back_cb), NULL);
    2.46 +    gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
    2.47 +
    2.48 +    /* The forward button */
    2.49 +    item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD);
    2.50 +    g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_forward_cb), NULL);
    2.51 +    gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
    2.52 +
    2.53  	/* URL entry */
    2.54  	item = gtk_tool_item_new ();
    2.55  	gtk_tool_item_set_expand (item, TRUE);
    2.56 +	
    2.57  	uri_entry = gtk_entry_new ();
    2.58 +	gtk_widget_modify_base ( GTK_WIDGET (uri_entry),
    2.59 +			GTK_STATE_NORMAL, &bg);
    2.60 +	gtk_entry_set_inner_border (GTK_ENTRY (uri_entry), NULL);
    2.61 +	gtk_entry_set_has_frame (GTK_ENTRY (uri_entry), FALSE);
    2.62 +	
    2.63  	gtk_container_add (GTK_CONTAINER (item), uri_entry);
    2.64  	g_signal_connect (G_OBJECT (uri_entry), "activate",
    2.65  			G_CALLBACK (uri_entry_cb), NULL);