From f3d36b1c26a25e267f9ddf2c7615dd707b3d7af4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Tue, 23 Oct 2012 23:59:58 +0200 Subject: [PATCH] Function makeIcon removed The function makeIcon is only used in icon_update_pixmap(), so both functions can be joined. Now the function icon_update_pixmap() includes the contents of makeIcon. --- src/icon.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/icon.c b/src/icon.c index b0da0d8d..791f8fb5 100644 --- a/src/icon.c +++ b/src/icon.c @@ -64,9 +64,6 @@ static void get_pixmap_icon_from_icon_win(WIcon *icon); static int get_pixmap_icon_from_wm_hints(WIcon *icon); static void get_pixmap_icon_from_user_icon(WIcon *icon); -static Pixmap makeIcon(WScreen *scr, RImage *image, - int titled, int shadowed, - int tileType, int highlighted); static void icon_update_pixmap(WIcon *icon, RImage *image); static RImage *get_default_image(WScreen *scr); @@ -274,23 +271,15 @@ static void drawIconTitle(WScreen * scr, Pixmap pixmap, int height) static void icon_update_pixmap(WIcon *icon, RImage *image) { - WScreen *scr = icon->core->screen_ptr; - - /* Update the WIcon pixmap */ - icon->pixmap = makeIcon(scr, image, - icon->show_title, icon->shadowed, - icon->tile_type, icon->highlighted); -} - -static Pixmap makeIcon(WScreen *scr, RImage *image, int titled, int shadowed, int tileType, int highlighted) -{ RImage *tile; Pixmap pixmap; int x, y, sx, sy; unsigned w, h; int theight = 0; + WScreen *scr = icon->core->screen_ptr; + int titled = icon->show_title; - if (tileType == TILE_NORMAL) { + if (icon->tile_type == TILE_NORMAL) { tile = RCloneImage(scr->icon_tile); } else { assert(scr->clip_tile); @@ -314,7 +303,7 @@ static Pixmap makeIcon(WScreen *scr, RImage *image, int titled, int shadowed, in RCombineArea(tile, image, sx, sy, w, h, x, y); } - if (shadowed) { + if (icon->shadowed) { RColor color; color.red = scr->icon_back_texture->light.red >> 8; @@ -324,7 +313,7 @@ static Pixmap makeIcon(WScreen *scr, RImage *image, int titled, int shadowed, in RClearImage(tile, &color); } - if (highlighted) { + if (icon->highlighted) { RColor color; color.red = color.green = color.blue = 0; @@ -340,7 +329,7 @@ static Pixmap makeIcon(WScreen *scr, RImage *image, int titled, int shadowed, in if (titled) drawIconTitle(scr, pixmap, theight); - return pixmap; + icon->pixmap = pixmap; } void wIconChangeTitle(WIcon * icon, char *new_title) -- 2.11.4.GIT