mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 22:28:02 +01:00
wIconChangeImageFile use set_icon_image_from_image
The function wIconChangeImageFile() now use set_icon_image_from_image() then: 1. Don't need call unset_icon_image() because the memory is free in the function set_icon_image_from_image(). 2. After update the icon info, it must set the file name. 3. The pixmap image could be updated.
This commit is contained in:
committed by
Carlos R. Mafra
parent
c088aba057
commit
c24499f6ad
@@ -362,12 +362,10 @@ Bool wIconChangeImageFile(WIcon *icon, char *file)
|
|||||||
|
|
||||||
/* New image! */
|
/* New image! */
|
||||||
if (!error && image) {
|
if (!error && image) {
|
||||||
/* Remove the old one */
|
|
||||||
unset_icon_image(icon);
|
|
||||||
|
|
||||||
/* Set the new image */
|
/* Set the new image */
|
||||||
|
set_icon_image_from_image(icon, image);
|
||||||
icon->file = wstrdup(path);
|
icon->file = wstrdup(path);
|
||||||
wIconUpdate(icon, image);
|
update_icon_pixmap(icon);
|
||||||
} else {
|
} else {
|
||||||
error = 1;
|
error = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user