diff --git a/draw.c b/draw.c index 4bbcff0cd..07f7bef3d 100644 --- a/draw.c +++ b/draw.c @@ -21,6 +21,7 @@ #include #include +#include #include "layout.h" #include "util.h" #include "draw.h" @@ -87,12 +88,36 @@ drawrectangle(Display *disp, int screen, int x, int y, int w, int h, Drawable dr } else cairo_rectangle(cr, x + 1, y, w, h); + cairo_stroke(cr); cairo_destroy(cr); cairo_surface_destroy(surface); } +void +drawcircle(Display *disp, int screen, int x, int y, int r, Drawable drawable, int dw, int dh, Bool filled, XColor color) +{ + cairo_surface_t *surface; + cairo_t *cr; + + surface = cairo_xlib_surface_create(disp, drawable, DefaultVisual(disp, screen), dw, dh); + cr = cairo_create (surface); + cairo_set_line_width(cr, 1.0); + cairo_set_source_rgb(cr, color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); + if(filled) + { + cairo_arc (cr, x + r, y + r, r, 0, 2 * M_PI); + cairo_fill(cr); + } + else + cairo_arc (cr, x + r + 1, y + r, r, 0, 2 * M_PI); + + cairo_stroke(cr); + + cairo_destroy(cr); + cairo_surface_destroy(surface); +} unsigned short textwidth(Display *disp, XftFont *font, char *text, ssize_t len) diff --git a/draw.h b/draw.h index 5070c1679..8d8d33dce 100644 --- a/draw.h +++ b/draw.h @@ -26,5 +26,6 @@ void drawtext(Display *, int, int, int, int, int, Drawable, int, int, XftFont *, const char *, XColor []); void drawrectangle(Display *, int, int, int, int, int, Drawable, int, int, Bool, XColor); +void drawcircle(Display *, int, int, int, int, Drawable, int, int, Bool, XColor); inline unsigned short textwidth(Display *, XftFont *, char *, ssize_t); #endif diff --git a/statusbar.c b/statusbar.c index 563fc6d51..021fd1603 100644 --- a/statusbar.c +++ b/statusbar.c @@ -140,15 +140,14 @@ drawstatusbar(Display *disp, awesome_config * awesomeconf) awesomeconf->font, sel->name, awesomeconf->colors_selected); if(sel->isfloating) - drawrectangle(disp, awesomeconf->phys_screen, - x, y, - (awesomeconf->font->height + 2) / 4, - (awesomeconf->font->height + 2) / 4, - awesomeconf->statusbar.drawable, - awesomeconf->statusbar.width, - awesomeconf->statusbar.height, - sel->ismax, - awesomeconf->colors_selected[ColFG]); + drawcircle(disp, awesomeconf->phys_screen, + x, y, + (awesomeconf->font->height + 2) / 4, + awesomeconf->statusbar.drawable, + awesomeconf->statusbar.width, + awesomeconf->statusbar.height, + sel->ismax, + awesomeconf->colors_selected[ColFG]); } else if(IS_ARRANGE(0, layout_tile) || IS_ARRANGE(0, layout_tileleft)) {