From 675b6e6255a5bb249d0c226d4e1ab0533e97a341 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 3 Jan 2008 17:15:21 +0100 Subject: [PATCH] use right statusbar in various widgets --- widgets/focustitle.c | 11 +++++------ widgets/taglist.c | 2 +- widgets/tasklist.c | 11 +++++------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/widgets/focustitle.c b/widgets/focustitle.c index 9bd28eb0a..576b55ef3 100644 --- a/widgets/focustitle.c +++ b/widgets/focustitle.c @@ -41,11 +41,10 @@ typedef struct static int focustitle_draw(Widget *widget, DrawCtx *ctx, int offset, int used) { - VirtScreen vscreen = globalconf.screens[widget->statusbar->screen]; Data *d = widget->data; Client *sel = focus_get_current_client(widget->statusbar->screen); - widget->location = widget_calculate_offset(vscreen.statusbar->width, + widget->location = widget_calculate_offset(widget->statusbar->width, 0, offset, widget->alignment); @@ -53,8 +52,8 @@ focustitle_draw(Widget *widget, DrawCtx *ctx, int offset, int used) if(sel) { draw_text(ctx, widget->location, 0, - vscreen.statusbar->width - used, - vscreen.statusbar->height, + widget->statusbar->width - used, + widget->statusbar->height, d->align, widget->font->height / 2, widget->font, sel->name, d->fg, d->bg); @@ -65,9 +64,9 @@ focustitle_draw(Widget *widget, DrawCtx *ctx, int offset, int used) } else draw_rectangle(ctx, widget->location, 0, - vscreen.statusbar->width - used, vscreen.statusbar->height, True, d->bg); + widget->statusbar->width - used, widget->statusbar->height, True, d->bg); - widget->width = vscreen.statusbar->width - used; + widget->width = widget->statusbar->width - used; return widget->width; } diff --git a/widgets/taglist.c b/widgets/taglist.c index cef344aaf..8e884256f 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -92,7 +92,7 @@ taglist_draw(Widget *widget, colors = vscreen.colors_normal; draw_text(ctx, widget->location + widget->width, 0, - w, vscreen.statusbar->height, + w, widget->statusbar->height, AlignCenter, vscreen.font->height / 2, vscreen.font, diff --git a/widgets/tasklist.c b/widgets/tasklist.c index ed977eca1..380e1b7ed 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -44,7 +44,6 @@ typedef struct static int tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used) { - VirtScreen vscreen = globalconf.screens[widget->statusbar->screen]; Client *c; Data *d = widget->data; Client *sel = focus_get_current_client(widget->statusbar->screen); @@ -60,9 +59,9 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used) return widget->width; } - box_width = (vscreen.statusbar->width - used) / n; + box_width = (widget->statusbar->width - used) / n; - widget->location = widget_calculate_offset(vscreen.statusbar->width, + widget->location = widget_calculate_offset(widget->statusbar->width, 0, offset, widget->alignment); @@ -74,7 +73,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used) { draw_text(ctx, widget->location + box_width * i, 0, box_width, - vscreen.statusbar->height, + widget->statusbar->height, d->align, widget->font->height / 2, widget->font, c->name, d->fg_sel, d->bg_sel); @@ -82,7 +81,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used) else draw_text(ctx, widget->location + box_width * i, 0, box_width, - vscreen.statusbar->height, + widget->statusbar->height, d->align, widget->font->height / 2, widget->font, c->name, d->fg, d->bg); @@ -93,7 +92,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used) i++; } - widget->width = vscreen.statusbar->width - used; + widget->width = widget->statusbar->width - used; return widget->width; }