From f6ea98649ceeff2628c91d020e5f22a45d332372 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 11 Oct 2007 15:44:30 +0200 Subject: [PATCH] drawsquare is now drawrectangle --- draw.c | 6 +++--- draw.h | 2 +- statusbar.c | 48 +++++++++++++++++++++++++++--------------------- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/draw.c b/draw.c index 12890f2f..fd2c00fb 100644 --- a/draw.c +++ b/draw.c @@ -71,7 +71,7 @@ drawtext(Display *disp, int screen, int x, int y, int w, int h, GC gc, Drawable } void -drawsquare(Display *disp, int screen, int x, int y, int h, Drawable drawable, int dw, int dh, Bool filled, XColor color) +drawrectangle(Display *disp, int screen, int x, int y, int w, int h, Drawable drawable, int dw, int dh, Bool filled, XColor color) { cairo_surface_t *surface; cairo_t *cr; @@ -84,11 +84,11 @@ drawsquare(Display *disp, int screen, int x, int y, int h, Drawable drawable, in cairo_set_source_rgb(cr, color.red, color.green, color.blue); if(filled) { - cairo_rectangle(cr, x + 1, y + 1, h + 1, h + 1); + cairo_rectangle(cr, x + 1, y + 1, w + 1, h + 1); cairo_fill(cr); } else - cairo_rectangle(cr, x + 1, y + 1, h, h); + cairo_rectangle(cr, x + 1, y + 1, w, h); cairo_stroke(cr); cairo_destroy(cr); diff --git a/draw.h b/draw.h index 7da01b3f..3becbea9 100644 --- a/draw.h +++ b/draw.h @@ -25,6 +25,6 @@ #include "config.h" void drawtext(Display *, int, int, int, int, int, GC, Drawable, XftFont *, const char *, XColor []); -void drawsquare(Display *, int, int, int, int, Drawable, int, int, Bool, XColor); +void drawrectangle(Display *, int, 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 124d0014..56b53f4f 100644 --- a/statusbar.c +++ b/statusbar.c @@ -70,13 +70,15 @@ drawstatusbar(Display *disp, awesome_config * awesomeconf) awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->tags[i].name, awesomeconf->colors_selected); if(isoccupied(i, awesomeconf->screen)) - drawsquare(disp, awesomeconf->phys_screen, - x, y, (awesomeconf->font->height + 2) / 4, - awesomeconf->statusbar.drawable, - awesomeconf->statusbar.width, - awesomeconf->statusbar.height, - sel && sel->tags[i], - awesomeconf->colors_selected[ColFG]); + 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 && sel->tags[i], + awesomeconf->colors_selected[ColFG]); } else { @@ -86,13 +88,15 @@ drawstatusbar(Display *disp, awesome_config * awesomeconf) awesomeconf->statusbar.drawable, awesomeconf->font, awesomeconf->tags[i].name, awesomeconf->colors_normal); if(isoccupied(i, awesomeconf->screen)) - drawsquare(disp, awesomeconf->phys_screen, - x, y, (awesomeconf->font->height + 2) / 4, - awesomeconf->statusbar.drawable, - awesomeconf->statusbar.width, - awesomeconf->statusbar.height, - sel && sel->tags[i], - awesomeconf->colors_normal[ColFG]); + 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 && sel->tags[i], + awesomeconf->colors_normal[ColFG]); } x += w; } @@ -126,13 +130,15 @@ drawstatusbar(Display *disp, awesome_config * awesomeconf) awesomeconf->statusbar.drawable, awesomeconf->font, sel->name, awesomeconf->colors_selected); if(sel->isfloating) - drawsquare(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]); + 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]); } else if(IS_ARRANGE(0, layout_tile) || IS_ARRANGE(0, layout_tileleft)) {