mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 14:42:29 +01:00
Icon: Replace code by call to helper function in wIconCreateWithIconFile
Code in the function wIconCreateWithIconFile does the same task as get_default_icon_rimage(), therefore replace it with a call to that function. It is the code to get the image file (rimage) using the file name.
This commit is contained in:
committed by
Carlos R. Mafra
parent
e988386013
commit
da5e2f8a0d
10
src/icon.c
10
src/icon.c
@@ -156,14 +156,8 @@ WIcon *wIconCreateWithIconFile(WScreen *scr, char *iconfile, int tile)
|
||||
|
||||
icon = wIconCreateCore(scr, 0, 0);
|
||||
|
||||
if (iconfile) {
|
||||
icon->file_image = RLoadImage(scr->rcontext, iconfile, 0);
|
||||
if (!icon->file_image)
|
||||
wwarning(_("error loading image file \"%s\": %s"), iconfile, RMessageForError(RErrorCode));
|
||||
|
||||
icon->file_image = wIconValidateIconSize(icon->file_image, wPreferences.icon_size);
|
||||
icon->file = wstrdup(iconfile);
|
||||
}
|
||||
icon->file_image = get_default_icon_rimage(scr, iconfile, wPreferences.icon_size);
|
||||
icon->file = wstrdup(iconfile);
|
||||
|
||||
icon->tile_type = tile;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user