diff -ur clearlooks.old/src/clearlooks_draw.c clearlooks/src/clearlooks_draw.c --- clearlooks.old/src/clearlooks_draw.c 2005-10-29 00:03:08.000000000 +0200 +++ clearlooks/src/clearlooks_draw.c 2005-10-29 00:53:00.000000000 +0200 @@ -643,11 +643,12 @@ const ClearlooksColors *colors, const WidgetParameters *params, const ProgressBarParameters *progressbar, - int x, int y, int width, int height) + int x, int y, int width, int height, gint offset) { boolean is_horizontal = progressbar->orientation < 2; double tile_pos = 0; double stroke_width; + int x_step; cairo_pattern_t *pattern; cairo_rectangle (cr, x, y, width, height); @@ -674,7 +675,8 @@ } stroke_width = height*2; - + x_step = (((float)stroke_width/10)*offset); + cairo_set_line_width (cr, 1.0); cairo_save (cr); @@ -698,10 +700,10 @@ /* Draw strokes */ while (tile_pos <= width) { - cairo_move_to (cr, stroke_width/2, 0); - cairo_line_to (cr, stroke_width, 0); - cairo_line_to (cr, stroke_width/2, height); - cairo_line_to (cr, 0, height); + cairo_move_to (cr, stroke_width/2-x_step, 0); + cairo_line_to (cr, stroke_width-x_step, 0); + cairo_line_to (cr, stroke_width/2-x_step, height); + cairo_line_to (cr, -x_step, height); cairo_translate (cr, stroke_width, 0); tile_pos += stroke_width; diff -ur clearlooks.old/src/clearlooks_draw.h clearlooks/src/clearlooks_draw.h --- clearlooks.old/src/clearlooks_draw.h 2005-10-29 00:03:08.000000000 +0200 +++ clearlooks/src/clearlooks_draw.h 2005-10-28 23:14:46.000000000 +0200 @@ -29,7 +29,7 @@ const ClearlooksColors *colors, const WidgetParameters *widget, const ProgressBarParameters *progressbar, - int x, int y, int width, int height); + int x, int y, int width, int height, gint offset); void clearlooks_draw_slider_button (cairo_t *cr, const ClearlooksColors *colors, diff -ur clearlooks.old/src/clearlooks_style.c clearlooks/src/clearlooks_style.c --- clearlooks.old/src/clearlooks_style.c 2005-10-29 00:03:09.000000000 +0200 +++ clearlooks/src/clearlooks_style.c 2005-10-29 00:44:34.000000000 +0200 @@ -32,6 +32,10 @@ gint width, \ gint height +static GList *progressbars = NULL; +static gint8 pboffset = 10; +static int timer_id = 0; + static GtkStyleClass *parent_class; static cairo_t * @@ -50,6 +54,63 @@ return cr; } +static void cl_progressbar_remove (gpointer data) +{ + if (g_list_find (progressbars, data) == NULL) + return; + + progressbars = g_list_remove (progressbars, data); + g_object_unref (data); + + if (g_list_first(progressbars) == NULL) { + g_source_remove(timer_id); + timer_id = 0; + } +} + +static void update_progressbar (gpointer data, gpointer user_data) +{ + gfloat fraction; + + if (data == NULL) + return; + + fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (data)); + + /* update only if not filled */ + if (fraction < 1.0) + gtk_widget_queue_resize ((GtkWidget*)data); + + if (fraction >= 1.0 || GTK_PROGRESS (data)->activity_mode) + cl_progressbar_remove (data); +} + +static gboolean timer_func (gpointer data) +{ + g_list_foreach (progressbars, update_progressbar, NULL); + if (--pboffset < 0) pboffset = 9; + return (g_list_first(progressbars) != NULL); +} + +static gboolean cl_progressbar_known(gconstpointer data) +{ + return (g_list_find (progressbars, data) != NULL); +} + +static void cl_progressbar_add (gpointer data) +{ + if (!GTK_IS_PROGRESS_BAR (data)) + return; + + progressbars = g_list_append (progressbars, data); + + g_object_ref (data); + g_signal_connect ((GObject*)data, "unrealize", G_CALLBACK (cl_progressbar_remove), data); + + if (timer_id == 0) + timer_id = g_timeout_add (100, timer_func, NULL); +} + static void clearlooks_set_widget_parameters (const GtkWidget *widget, const GtkStyle *style, @@ -571,6 +632,14 @@ WidgetParameters params; ProgressBarParameters progressbar; + gboolean activity_mode = GTK_PROGRESS (widget)->activity_mode; + + if (!activity_mode && gtk_progress_bar_get_fraction (widget) != 1.0 && + !cl_progressbar_known((gconstpointer)widget)) + { + cl_progressbar_add ((gpointer)widget); + } + clearlooks_set_widget_parameters (widget, style, state_type, ¶ms); if (widget && GTK_IS_PROGRESS_BAR (widget)) @@ -581,7 +650,7 @@ cairo_reset_clip (cr); clearlooks_draw_progressbar_fill (cr, colors, ¶ms, &progressbar, - x, y, width, height); + x, y, width, height, pboffset); } else if (DETAIL ("hscale") || DETAIL ("vscale"))