tazweb rev 73

Small code clean-up and add .hgignore (ignore tazweb binary if in repo)
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 23 23:37:34 2011 +0200 (2011-04-23)
parents 5bc3369a201f
children 22ccdae2c559
files .hgignore src/main.c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/.hgignore	Sat Apr 23 23:37:34 2011 +0200
     1.3 @@ -0,0 +1,1 @@
     1.4 +tazweb
     2.1 --- a/src/main.c	Sat Apr 23 16:13:48 2011 +0100
     2.2 +++ b/src/main.c	Sat Apr 23 23:37:34 2011 +0200
     2.3 @@ -21,12 +21,9 @@
     2.4  static GtkWidget *uri_entry, *search_entry;
     2.5  static WebKitWebView* web_view;
     2.6  static WebKitWebFrame* frame;
     2.7 -static gdouble load_progress;
     2.8 -static guint status_context_id;
     2.9 +static gint progress;
    2.10  static gchar* main_title;
    2.11  static gchar* title;
    2.12 -static gint progress;
    2.13 -static gint loader_width;
    2.14  const gchar* uri;
    2.15  
    2.16  /* Create an icon */
    2.17 @@ -50,18 +47,19 @@
    2.18  static void
    2.19  draw_loader ()
    2.20  {
    2.21 -	GdkGC* gc = gdk_gc_new (loader->window);
    2.22 +	GdkGC* gc;
    2.23  	GdkColor fg;
    2.24 +	gint width;
    2.25  
    2.26 -	uri = webkit_web_view_get_uri (web_view);
    2.27 -	loader_width = progress * loader->allocation.width / 100;
    2.28 +	gc = gdk_gc_new (loader->window);
    2.29 +	width = progress * loader->allocation.width / 100;
    2.30  	
    2.31  	gdk_color_parse (loader_color, &fg);
    2.32  	gdk_gc_set_rgb_fg_color (gc, &fg);
    2.33  	gdk_draw_rectangle (loader->window,
    2.34  			loader->style->bg_gc [GTK_WIDGET_STATE (loader)],
    2.35  			TRUE, 0, 0, loader->allocation.width, loader->allocation.height);
    2.36 -	gdk_draw_rectangle (loader->window, gc, TRUE, 0, 0, loader_width,
    2.37 +	gdk_draw_rectangle (loader->window, gc, TRUE, 0, 0, width,
    2.38  			loader->allocation.height);
    2.39  	g_object_unref (gc);
    2.40  }
    2.41 @@ -329,16 +327,14 @@
    2.42  create_toolbar ()
    2.43  {
    2.44  	GtkToolItem* item;
    2.45 -	PangoFontDescription *font;
    2.46 -	GdkColor bg;
    2.47 -	
    2.48 +
    2.49  	toolbar = gtk_toolbar_new ();
    2.50 -	
    2.51 +	//gtk_widget_set_size_request (toolbar, 0, 24);
    2.52  	gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar),
    2.53  			GTK_ORIENTATION_HORIZONTAL);
    2.54  	gtk_toolbar_set_style (GTK_TOOLBAR (toolbar),
    2.55  			GTK_TOOLBAR_BOTH_HORIZ);
    2.56 -	
    2.57 +	GdkColor bg;
    2.58  	gdk_color_parse ("#f1efeb", &bg);
    2.59  	gtk_widget_modify_bg (toolbar, GTK_STATE_NORMAL, &bg);
    2.60  
    2.61 @@ -402,7 +398,7 @@
    2.62  	GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    2.63  	GtkWidget* vbox = gtk_vbox_new (FALSE, 0);
    2.64  
    2.65 -	/* Default TazWeb window size ratio to 3/4 --> 720, 540*/
    2.66 +	/* Default TazWeb window size ratio to 3/4 --> 720, 540 */
    2.67  	gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
    2.68  	gtk_window_set_icon (GTK_WINDOW (window),
    2.69  			create_pixbuf ("/usr/share/pixmaps/tazweb.png"));