diff --git a/draw.c b/draw.c index 20d095b2..2ebcaf89 100644 --- a/draw.c +++ b/draw.c @@ -107,7 +107,7 @@ draw_text(DrawCtx *ctx, len = sizeof(buf) - 1; memcpy(buf, text, len); buf[len] = 0; - while(len && (nw = (textwidth(font, buf)) + padding * 2) > w) + while(len && (nw = (draw_textwidth(font, buf)) + padding * 2) > w) buf[--len] = 0; if(nw > w) return; /* too long */ @@ -325,7 +325,7 @@ draw_rotate(DrawCtx *ctx, int screen, double angle, int tx, int ty) } unsigned short -textwidth(XftFont *font, char *text) +draw_textwidth(XftFont *font, char *text) { cairo_surface_t *surface; cairo_t *cr; diff --git a/draw.h b/draw.h index 798d988d..653754df 100644 --- a/draw.h +++ b/draw.h @@ -62,7 +62,7 @@ void draw_image(DrawCtx *, int, int, int, const char *); void draw_image_from_argb_data(DrawCtx *, int, int, int, int, int, unsigned char *); Area draw_get_image_size(const char *filename); Drawable draw_rotate(DrawCtx *, int, double, int, int); -unsigned short textwidth(XftFont *, char *); +unsigned short draw_textwidth(XftFont *, char *); Alignment draw_get_align(const char *); #endif diff --git a/widgets/taglist.c b/widgets/taglist.c index dc8c21ba..f04a085b 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -73,7 +73,7 @@ taglist_draw(Widget *widget, widget->area.width = 0; for(tag = vscreen.tags; tag; tag = tag->next) - widget->area.width += textwidth(vscreen.font, tag->name) + vscreen.font->height; + widget->area.width += draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(!widget->user_supplied_x) widget->area.x = widget_calculate_offset(widget->statusbar->width, @@ -87,7 +87,7 @@ taglist_draw(Widget *widget, widget->area.width = 0; for(tag = vscreen.tags; tag; tag = tag->next) { - w = textwidth(vscreen.font, tag->name) + vscreen.font->height; + w = draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(tag->selected) colors = vscreen.colors_selected; else if(isurgent(tag)) @@ -132,7 +132,7 @@ taglist_button_press(Widget *widget, XButtonPressedEvent *ev) case Bottom: for(tag = vscreen.tags; tag; tag = tag->next, i++) { - width = textwidth(vscreen.font, tag->name) + vscreen.font->height; + width = draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(ev->x >= widget->area.x + prev_width && ev->x < widget->area.x + prev_width + width) { @@ -146,7 +146,7 @@ taglist_button_press(Widget *widget, XButtonPressedEvent *ev) case Right: for(tag = vscreen.tags; tag; tag = tag->next, i++) { - width = textwidth(vscreen.font, tag->name) + vscreen.font->height; + width = draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(ev->y >= widget->area.x + prev_width && ev->y < widget->area.x + prev_width + width) { @@ -160,7 +160,7 @@ taglist_button_press(Widget *widget, XButtonPressedEvent *ev) default: for(tag = vscreen.tags; tag; tag = tag->next, i++) { - width = textwidth(vscreen.font, tag->name) + vscreen.font->height; + width = draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(widget->statusbar->width - ev->y >= widget->area.x + prev_width && widget->statusbar->width - ev->y < widget->area.x + prev_width + width) { diff --git a/widgets/textbox.c b/widgets/textbox.c index faea73e4..10900bea 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -44,7 +44,7 @@ textbox_draw(Widget *widget, DrawCtx *ctx, int offset, if(d->width) widget->area.width = d->width; else - widget->area.width = textwidth(widget->font, d->text); + widget->area.width = draw_textwidth(widget->font, d->text); widget->area.height = widget->statusbar->height;