diff -uNar clearlooks.cvs/src/clearlooks_draw.c clearlooks/src/clearlooks_draw.c --- clearlooks.cvs/src/clearlooks_draw.c 2005-11-26 18:30:52.000000000 +0100 +++ clearlooks/src/clearlooks_draw.c 2005-12-08 23:24:34.000000000 +0100 @@ -495,6 +495,30 @@ cairo_stroke (cr); } +static void +clearlooks_scale_draw_gradient_alpha (cairo_t *cr, + const CairoColor *c1, + const CairoColor *c2, + const CairoColor *c3, + int x, int y, int width, int height, + boolean horizontal, const double alpha) +{ + cairo_pattern_t *pattern; + + pattern = cairo_pattern_create_linear (0, 0, horizontal ? 0 : width, horizontal ? height : 0); + cairo_pattern_add_color_stop_rgba (pattern, 0.0, c1->r, c1->g, c1->b, alpha); + cairo_pattern_add_color_stop_rgba (pattern, 1.0, c2->r, c2->g, c2->b, alpha); + + cairo_rectangle (cr, x+0.5, y+0.5, width-1, height-1); + cairo_set_source (cr, pattern); + cairo_fill (cr); + cairo_pattern_destroy (pattern); + + cairo_rectangle (cr, x, y, width, height); + cairo_set_source_rgb (cr, c3->r, c3->g, c3->b); + cairo_stroke (cr); +} + #define TROUGH_SIZE 6 void clearlooks_draw_scale_trough (cairo_t *cr, @@ -505,7 +529,7 @@ { int fill_x, fill_y, fill_width, fill_height; /* Fill x,y,w,h */ int trough_width, trough_height; - double translate_x, translate_y; + double translate_x, translate_y, tran; int fill_size = slider->fill_size; if (slider->horizontal) @@ -553,11 +577,17 @@ 0, 0, trough_width, trough_height, slider->horizontal); - clearlooks_scale_draw_gradient (cr, &colors->spot[1], /* top */ - &colors->spot[0], /* bottom */ - &colors->spot[2], /* border */ - fill_x, fill_y, fill_width, fill_height, - slider->horizontal); + //calculate transparency + if (slider->horizontal) + tran = 0.5 + (float)fill_width/(width*2); + else + tran = 0.5 + (float)fill_height/(height*2); + printf("Trans %f\n",tran); + clearlooks_scale_draw_gradient_alpha (cr, &colors->spot[1], /* top */ + &colors->spot[0], /* bottom */ + &colors->spot[2], /* border */ + fill_x, fill_y, fill_width, fill_height, + slider->horizontal, tran); } void