From 2c0a449f00fc4f377605067bec2112d82beb4ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Mon, 8 Apr 2013 19:40:48 +0200 Subject: [PATCH] drawIconTitle renamed The function drawIconTitle() only draw the icon title square, without the title. The title must be set later, because yet is not initialized, so is NULL. Then, the right function name should be drawIconTitleBackground. This patch also removes the variable titled. --- src/icon.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/icon.c b/src/icon.c index 1de08dba..a6bba718 100644 --- a/src/icon.c +++ b/src/icon.c @@ -229,7 +229,7 @@ void wIconDestroy(WIcon * icon) wfree(icon); } -static void drawIconTitle(WScreen * scr, Pixmap pixmap, int height) +static void drawIconTitleBackground(WScreen *scr, Pixmap pixmap, int height) { XFillRectangle(dpy, pixmap, scr->icon_title_texture->normal_gc, 0, 0, wPreferences.icon_size, height + 1); XDrawLine(dpy, pixmap, scr->icon_title_texture->light_gc, 0, 0, wPreferences.icon_size, 0); @@ -246,7 +246,6 @@ static void icon_update_pixmap(WIcon *icon, RImage *image) unsigned w, h; int theight = 0; WScreen *scr = icon->core->screen_ptr; - int titled = icon->show_title; if (icon->tile_type == TILE_NORMAL) { tile = RCloneImage(scr->icon_tile); @@ -261,7 +260,7 @@ static void icon_update_pixmap(WIcon *icon, RImage *image) x = (wPreferences.icon_size - w) / 2; sx = (image->width - w) / 2; - if (titled) + if (icon->show_title) theight = WMFontHeight(scr->icon_title_font); h = (image->height + theight > wPreferences.icon_size @@ -295,8 +294,9 @@ static void icon_update_pixmap(WIcon *icon, RImage *image) RReleaseImage(tile); - if (titled) - drawIconTitle(scr, pixmap, theight); + /* Draw the icon's title background (without text) */ + if (icon->show_title) + drawIconTitleBackground(scr, pixmap, theight); icon->pixmap = pixmap; }