From b1c62a618fddc3251aa2e7214ca4d934a45dc4cb Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 5 Jan 2008 12:44:14 +0100 Subject: [PATCH] store widget height --- widgets/focustitle.c | 1 + widgets/iconbox.c | 2 ++ widgets/layoutinfo.c | 4 +++- widgets/netwmicon.c | 2 ++ widgets/progressbar.c | 1 + widgets/taglist.c | 1 + widgets/tasklist.c | 1 + widgets/textbox.c | 2 ++ 8 files changed, 13 insertions(+), 1 deletion(-) diff --git a/widgets/focustitle.c b/widgets/focustitle.c index 190ebd5cc..4f7bca3e1 100644 --- a/widgets/focustitle.c +++ b/widgets/focustitle.c @@ -71,6 +71,7 @@ focustitle_draw(Widget *widget, DrawCtx *ctx, int offset, int used) widget->statusbar->width - used, widget->statusbar->height, True, d->bg); widget->area.width = widget->statusbar->width - used; + widget->area.height = widget->statusbar->height; return widget->area.width; } diff --git a/widgets/iconbox.c b/widgets/iconbox.c index 7b9bd1254..62e12ab03 100644 --- a/widgets/iconbox.c +++ b/widgets/iconbox.c @@ -42,6 +42,8 @@ iconbox_draw(Widget *widget, DrawCtx *ctx, int offset, else widget->area.width = area.width; + widget->area.height = widget->statusbar->height; + if(!widget->user_supplied_x) widget->area.x = widget_calculate_offset(widget->statusbar->width, widget->area.width, diff --git a/widgets/layoutinfo.c b/widgets/layoutinfo.c index 90172d7bc..3b3aaa383 100644 --- a/widgets/layoutinfo.c +++ b/widgets/layoutinfo.c @@ -34,6 +34,7 @@ layoutinfo_draw(Widget *widget, int used __attribute__ ((unused))) { Tag **curtags = get_current_tags(widget->statusbar->screen); + Area area = draw_get_image_size(curtags[0]->layout->image); if(!widget->user_supplied_x) widget->area.x = widget_calculate_offset(widget->statusbar->width, @@ -44,7 +45,8 @@ layoutinfo_draw(Widget *widget, if(!widget->user_supplied_y) widget->area.y = 0; - widget->area.width = widget->statusbar->height; + widget->area.width = ((double) widget->statusbar->height / (double) area.height) * area.width;; + widget->area.height = widget->statusbar->height; draw_image(ctx, widget->area.x, widget->area.y, widget->statusbar->height, diff --git a/widgets/netwmicon.c b/widgets/netwmicon.c index 119c77d1c..976897ba3 100644 --- a/widgets/netwmicon.c +++ b/widgets/netwmicon.c @@ -45,6 +45,8 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset, return 0; } + widget->area.height = widget->statusbar->height; + for(r = globalconf.rules; r; r = r->next) if(r->icon && client_match_rule(sel, r)) { diff --git a/widgets/progressbar.c b/widgets/progressbar.c index dad829235..139eb9c84 100644 --- a/widgets/progressbar.c +++ b/widgets/progressbar.c @@ -101,6 +101,7 @@ progressbar_draw(Widget *widget, DrawCtx *ctx, int offset, } widget->area.width = d->width; + widget->area.height = widget->statusbar->height; return widget->area.width; } diff --git a/widgets/taglist.c b/widgets/taglist.c index 084a13531..dc8c21ba8 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -111,6 +111,7 @@ taglist_draw(Widget *widget, widget->area.width += w; } + widget->area.height = widget->statusbar->height; return widget->area.width; } diff --git a/widgets/tasklist.c b/widgets/tasklist.c index 9008530fb..4306ba1d8 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -136,6 +136,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used) } widget->area.width = widget->statusbar->width - used; + widget->area.height = widget->statusbar->height; return widget->area.width; } diff --git a/widgets/textbox.c b/widgets/textbox.c index 6176dce2a..faea73e48 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -46,6 +46,8 @@ textbox_draw(Widget *widget, DrawCtx *ctx, int offset, else widget->area.width = textwidth(widget->font, d->text); + widget->area.height = widget->statusbar->height; + if(!widget->user_supplied_x) widget->area.x = widget_calculate_offset(widget->statusbar->width, widget->area.width,