tazweb diff src/main.c @ 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
line diff
     1.1 --- a/src/main.c	Sat Apr 23 16:13:48 2011 +0100
     1.2 +++ b/src/main.c	Sat Apr 23 23:37:34 2011 +0200
     1.3 @@ -21,12 +21,9 @@
     1.4  static GtkWidget *uri_entry, *search_entry;
     1.5  static WebKitWebView* web_view;
     1.6  static WebKitWebFrame* frame;
     1.7 -static gdouble load_progress;
     1.8 -static guint status_context_id;
     1.9 +static gint progress;
    1.10  static gchar* main_title;
    1.11  static gchar* title;
    1.12 -static gint progress;
    1.13 -static gint loader_width;
    1.14  const gchar* uri;
    1.15  
    1.16  /* Create an icon */
    1.17 @@ -50,18 +47,19 @@
    1.18  static void
    1.19  draw_loader ()
    1.20  {
    1.21 -	GdkGC* gc = gdk_gc_new (loader->window);
    1.22 +	GdkGC* gc;
    1.23  	GdkColor fg;
    1.24 +	gint width;
    1.25  
    1.26 -	uri = webkit_web_view_get_uri (web_view);
    1.27 -	loader_width = progress * loader->allocation.width / 100;
    1.28 +	gc = gdk_gc_new (loader->window);
    1.29 +	width = progress * loader->allocation.width / 100;
    1.30  	
    1.31  	gdk_color_parse (loader_color, &fg);
    1.32  	gdk_gc_set_rgb_fg_color (gc, &fg);
    1.33  	gdk_draw_rectangle (loader->window,
    1.34  			loader->style->bg_gc [GTK_WIDGET_STATE (loader)],
    1.35  			TRUE, 0, 0, loader->allocation.width, loader->allocation.height);
    1.36 -	gdk_draw_rectangle (loader->window, gc, TRUE, 0, 0, loader_width,
    1.37 +	gdk_draw_rectangle (loader->window, gc, TRUE, 0, 0, width,
    1.38  			loader->allocation.height);
    1.39  	g_object_unref (gc);
    1.40  }
    1.41 @@ -329,16 +327,14 @@
    1.42  create_toolbar ()
    1.43  {
    1.44  	GtkToolItem* item;
    1.45 -	PangoFontDescription *font;
    1.46 -	GdkColor bg;
    1.47 -	
    1.48 +
    1.49  	toolbar = gtk_toolbar_new ();
    1.50 -	
    1.51 +	//gtk_widget_set_size_request (toolbar, 0, 24);
    1.52  	gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar),
    1.53  			GTK_ORIENTATION_HORIZONTAL);
    1.54  	gtk_toolbar_set_style (GTK_TOOLBAR (toolbar),
    1.55  			GTK_TOOLBAR_BOTH_HORIZ);
    1.56 -	
    1.57 +	GdkColor bg;
    1.58  	gdk_color_parse ("#f1efeb", &bg);
    1.59  	gtk_widget_modify_bg (toolbar, GTK_STATE_NORMAL, &bg);
    1.60  
    1.61 @@ -402,7 +398,7 @@
    1.62  	GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    1.63  	GtkWidget* vbox = gtk_vbox_new (FALSE, 0);
    1.64  
    1.65 -	/* Default TazWeb window size ratio to 3/4 --> 720, 540*/
    1.66 +	/* Default TazWeb window size ratio to 3/4 --> 720, 540 */
    1.67  	gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
    1.68  	gtk_window_set_icon (GTK_WINDOW (window),
    1.69  			create_pixbuf ("/usr/share/pixmaps/tazweb.png"));