369a370,423
> static float
> _win_title_get_percent(const char *text)
> {
> 	float percent = -1.0;
> 	
> 	//find percentages
> 	char *pct_chr = strchr(text, '%');
> 	if(pct_chr)
> 	{
> 	  char *pct_chr2 = strchr(&pct_chr[1], '%');
> 	  if(!pct_chr2) //only one '%' in the title
> 	  {
> 		  //look back, find the beginning of the number
> 		  int found_digit = 0; //did we find any number?
> 		  while(pct_chr != text)
> 		  {
> 			  pct_chr = &pct_chr[-1];
> 			  
> 			  //todo: this should check for the system's decimal separator
> 			  if((pct_chr[0] == '.') || (pct_chr[0] == ',')
> 			  || ((pct_chr[0] >= '0') && (pct_chr[0] <= '9')))
> 				found_digit = 1;
> 			  else if(found_digit) break;
> 		  }
> 		  
> 		  if(found_digit) //this is a number, not a stray '%'
> 		  {
> 			  sscanf(pct_chr, "%f", &percent);
> 			  if(percent > 100) percent = 100;
> 			  else if(percent < 0) percent = 0;
> 		  }
> 	  }
> 	}
> 	//todo: might look for "x of y" as well
> 	
> 	return percent;
> }
> 
> static int
> _task_set_label(WnckTask *task, const char *text)
> {
> 	float percent = _win_title_get_percent(text);
> 
>     gtk_progress_bar_set_text (GTK_PROGRESS_BAR (task->label), text);	
> 	if(percent >= 0.0)
> 	{
> 	  gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(task->label),
> 		percent / 100.0);
> 	  return 1;
> 	}
> 
> 	return 0;
> }
> 
1756a1810
> 	  
2223a2278,2281
> 	
>   //todo: this should be a flag in tasklist->priv, but I can't modify that
>   if (_win_title_get_percent(wnck_window_get_name(win)) >= 0.0)
>     return TRUE;
3353a3412
>   int set_progress = 0;
3357c3416
<       gtk_label_set_text (GTK_LABEL (task->label), text);
---
>       set_progress = _task_set_label(task, text);
3360c3419,3422
<           _make_gtk_label_bold ((GTK_LABEL (task->label)));
---
> 		  //this function can actually accept any GtkWidget. However, changing
> 		  //its prototype may well break the hell out of everything, so here's
> 		  //a nasty hack instead.
>           _make_gtk_label_bold ((GtkLabel*)task->label);
3365c3427
<           _make_gtk_label_normal ((GTK_LABEL (task->label)));
---
>           _make_gtk_label_normal ((GtkLabel*)task->label);
3369a3432,3433
>   if(!set_progress)
>     gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(task->label), 0);
3795,3797c3859,3866
<   task->label = gtk_label_new (text);
<   gtk_misc_set_alignment (GTK_MISC (task->label), 0.0, 0.5);
<   gtk_label_set_ellipsize (GTK_LABEL (task->label),
---
>   
>   //task->label = gtk_label_new (text);
>   task->label = gtk_progress_bar_new();
>   _task_set_label(task, text);
>   gtk_widget_set_name (task->label, "tasklist-progressbar");
>   
>   //gtk_misc_set_alignment (GTK_MISC (task->label), 0.0, 0.5);
>   gtk_progress_bar_set_ellipsize (GTK_PROGRESS_BAR (task->label),
3802c3871
<       _make_gtk_label_bold ((GTK_LABEL (task->label)));
---
>       _make_gtk_label_bold ((GtkLabel*)task->label);
3811c3880
< 		      TASKLIST_BUTTON_PADDING);
---
> 		      0);
