From c4b1867a4d0ecc12afc5025202c85ec3eea0ae02 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 9 Oct 2007 22:29:44 +0200 Subject: [PATCH] remove h attribute of drawcontext --- awesome.c | 2 +- config.h | 2 +- statusbar.c | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/awesome.c b/awesome.c index c72883043..1694efdc2 100644 --- a/awesome.c +++ b/awesome.c @@ -203,7 +203,7 @@ setup(DC *drawcontext, awesome_config *awesomeconf) compileregs(awesomeconf->rules, awesomeconf->nrules); /* bar */ - drawcontext->h = awesomeconf->statusbar.height = drawcontext->font->height + 2; + awesomeconf->statusbar.height = drawcontext->font->height + 2; initstatusbar(awesomeconf->display, awesomeconf->screen, drawcontext, &awesomeconf->statusbar); drawcontext->gc = XCreateGC(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), 0, 0); XSetLineAttributes(awesomeconf->display, drawcontext->gc, 1, LineSolid, CapButt, JoinMiter); diff --git a/config.h b/config.h index 0bc98f068..9ac8095db 100644 --- a/config.h +++ b/config.h @@ -39,7 +39,7 @@ enum typedef struct { - int x, y, w, h; + int x, y, w; unsigned long norm[ColLast]; unsigned long sel[ColLast]; XColor text_normal; diff --git a/statusbar.c b/statusbar.c index a3f9ce9af..27cefe53e 100644 --- a/statusbar.c +++ b/statusbar.c @@ -59,20 +59,20 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf) drawcontext->w = textwidth(disp, drawcontext->font, awesomeconf->tags[i].name, a_strlen(awesomeconf->tags[i].name)) + drawcontext->font->height; if(awesomeconf->tags[i].selected) { - drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, drawcontext->h, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, awesomeconf->tags[i].name, drawcontext->sel, drawcontext->text_selected); + drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, awesomeconf->tags[i].name, drawcontext->sel, drawcontext->text_selected); if(isoccupied(i, awesomeconf->screen)) drawsquare(disp, drawcontext->x, drawcontext->y, (drawcontext->font->height + 2) / 4, drawcontext->gc, awesomeconf->statusbar.drawable, sel && sel->tags[i], drawcontext->sel[ColFG]); } else { - drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, drawcontext->h, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, awesomeconf->tags[i].name, drawcontext->norm, drawcontext->text_normal); + drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, awesomeconf->tags[i].name, drawcontext->norm, drawcontext->text_normal); if(isoccupied(i, awesomeconf->screen)) drawsquare(disp, drawcontext->x, drawcontext->y, (drawcontext->font->height + 2) / 4, drawcontext->gc, awesomeconf->statusbar.drawable, sel && sel->tags[i], drawcontext->norm[ColFG]); } drawcontext->x += drawcontext->w; } drawcontext->w = awesomeconf->statusbar.width; - drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, drawcontext->h, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, awesomeconf->current_layout->symbol, drawcontext->norm, drawcontext->text_normal); + drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, awesomeconf->current_layout->symbol, drawcontext->norm, drawcontext->text_normal); x = drawcontext->x + drawcontext->w; drawcontext->w = textwidth(disp, drawcontext->font, awesomeconf->statustext, a_strlen(awesomeconf->statustext)) + drawcontext->font->height; drawcontext->x = si[awesomeconf->screen].width - drawcontext->w; @@ -81,13 +81,13 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf) drawcontext->x = x; drawcontext->w = si[awesomeconf->screen].width - x; } - drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, drawcontext->h, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, awesomeconf->statustext, drawcontext->norm, drawcontext->text_normal); + drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, awesomeconf->statustext, drawcontext->norm, drawcontext->text_normal); if((drawcontext->w = drawcontext->x - x) > awesomeconf->statusbar.height) { drawcontext->x = x; if(sel) { - drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, drawcontext->h, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, sel->name, drawcontext->sel, drawcontext->text_selected); + drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, sel->name, drawcontext->sel, drawcontext->text_selected); if(sel->isfloating) drawsquare(disp, drawcontext->x, drawcontext->y, (drawcontext->font->height + 2) / 4, drawcontext->gc, awesomeconf->statusbar.drawable, sel->ismax, drawcontext->sel[ColFG]); } @@ -95,10 +95,10 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf) { char buf[256]; snprintf(buf, sizeof(buf), "nmaster: %d ncol: %d mwfact: %.2lf", awesomeconf->nmaster, awesomeconf->ncol, awesomeconf->mwfact); - drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, drawcontext->h, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, buf, drawcontext->norm, drawcontext->text_normal); + drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, buf, drawcontext->norm, drawcontext->text_normal); } else - drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, drawcontext->h, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, NULL, drawcontext->norm, drawcontext->text_normal); + drawtext(disp, awesomeconf->phys_screen, drawcontext->x, drawcontext->y, drawcontext->w, awesomeconf->statusbar.height, drawcontext->gc, awesomeconf->statusbar.drawable, drawcontext->font, NULL, drawcontext->norm, drawcontext->text_normal); } XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, drawcontext->gc, 0, 0, si[awesomeconf->screen].width, awesomeconf->statusbar.height, 0, 0); XSync(disp, False);