diff options
Diffstat (limited to 'draw.c')
| -rw-r--r-- | draw.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -49,7 +49,10 @@ void draw(Window *win) int radius = height / 2; double degree = M_PI / 180.0; - cairo_set_source_rgb(cr, 0.3, 0.3, 0.3); + // FIXME: Alpha transparency is not working + double alpha = 0.8; + + cairo_set_source_rgba(cr, 0.3, 0.3, 0.3, alpha); // TODO: Here we should paint the shape of the bar, however there is a problem with the surface // painted in the pixmap to mask the window shape in window_paint_corners. @@ -73,18 +76,18 @@ void draw(Window *win) int x = (height + cairo_get_line_width(cr) * scale * 2) * i; // purple - cairo_set_source_rgb(cr, 0.502, 0.168, 0.886); + cairo_set_source_rgba(cr, 0.502, 0.168, 0.886, alpha); cairo_arc(cr, x + radius, radius, radius, 0 * degree, 360 * degree); cairo_fill(cr); - cairo_set_source_rgb(cr, 0.8, 0.8, 0.8); + cairo_set_source_rgba(cr, 0.8, 0.8, 0.8, alpha); cairo_arc(cr, x + radius, radius, radius - 1, 0 * degree, 360 * degree); cairo_stroke(cr); + cairo_set_source_rgb(cr, 0.8, 0.8, 0.8); char btn[] = { '1' + i, '\0' }; pango_layout_set_text(layout, btn, -1); - int text_w, text_h; pango_layout_get_pixel_size(layout, &text_w, &text_h); text_w = ceil(text_w / scale); |
