mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 22:52:34 +01:00
Split get_pixmap_icon_from_default_icon() into two
The function get_pixmap_icon_from_default_icon() is splitted in two functions now: 1. get_rimage_icon_from_default_icon, set the rimage at icon->image The code comes from the function get_pixmap_icon_from_default_icon() 2. The get_pixmap_icon_from_default_icon(), but now only converts the icon->file_image in icon->pixmap
This commit is contained in:
committed by
Carlos R. Mafra
parent
2ff138f311
commit
8349a018f0
18
src/icon.c
18
src/icon.c
@@ -64,6 +64,7 @@ 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 void get_pixmap_icon_from_default_icon(WIcon *icon);
|
||||
static void get_rimage_icon_from_default_icon(WIcon *icon);
|
||||
|
||||
static void icon_update_pixmap(WIcon *icon, RImage *image);
|
||||
static void unset_icon_image(WIcon *icon);
|
||||
@@ -638,7 +639,7 @@ static void get_pixmap_icon_from_user_icon(WIcon *icon)
|
||||
get_pixmap_icon_from_default_icon(icon);
|
||||
}
|
||||
|
||||
static void get_pixmap_icon_from_default_icon(WIcon *icon)
|
||||
static void get_rimage_icon_from_default_icon(WIcon *icon)
|
||||
{
|
||||
WScreen *scr = icon->core->screen_ptr;
|
||||
|
||||
@@ -646,8 +647,21 @@ static void get_pixmap_icon_from_default_icon(WIcon *icon)
|
||||
if (!scr->def_icon_rimage)
|
||||
scr->def_icon_rimage = get_default_image(scr);
|
||||
|
||||
/* Remove the icon image */
|
||||
unset_icon_image(icon);
|
||||
|
||||
/* Set the new icon image */
|
||||
icon->file = NULL;
|
||||
icon->file_image = RRetainImage(scr->def_icon_rimage);
|
||||
}
|
||||
|
||||
static void get_pixmap_icon_from_default_icon(WIcon *icon)
|
||||
{
|
||||
/* Update icon->file image */
|
||||
get_rimage_icon_from_default_icon(icon);
|
||||
|
||||
/* Now, create the pixmap using the default (saved) image */
|
||||
icon_update_pixmap(icon, scr->def_icon_rimage);
|
||||
icon_update_pixmap(icon, icon->file_image);
|
||||
}
|
||||
|
||||
/* This function creates the RImage using the default icon */
|
||||
|
||||
Reference in New Issue
Block a user