mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 14:42:29 +01:00
New helper function get_pixmap_icon_from_default_icon
The new helper function get_pixmap_icon_from_default_icon search the default icon in the disk and return it. Now get_pixmap_icon_from_user_icon() returns do the work about search the user icon, and the work about default icon is splitted in the function get_pixmap_icon_from_user_icon.
This commit is contained in:
committed by
Carlos R. Mafra
parent
f3d36b1c26
commit
b8025ee899
10
src/icon.c
10
src/icon.c
@@ -63,6 +63,7 @@ static WIcon *icon_create_core(WScreen *scr, int coord_x, int coord_y);
|
|||||||
static void get_pixmap_icon_from_icon_win(WIcon *icon);
|
static void get_pixmap_icon_from_icon_win(WIcon *icon);
|
||||||
static int get_pixmap_icon_from_wm_hints(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_user_icon(WIcon *icon);
|
||||||
|
static void get_pixmap_icon_from_default_icon(WIcon *icon);
|
||||||
|
|
||||||
static void icon_update_pixmap(WIcon *icon, RImage *image);
|
static void icon_update_pixmap(WIcon *icon, RImage *image);
|
||||||
|
|
||||||
@@ -617,14 +618,19 @@ void wIconUpdate(WIcon *icon)
|
|||||||
|
|
||||||
static void get_pixmap_icon_from_user_icon(WIcon *icon)
|
static void get_pixmap_icon_from_user_icon(WIcon *icon)
|
||||||
{
|
{
|
||||||
WScreen *scr = icon->core->screen_ptr;
|
|
||||||
|
|
||||||
/* If the icon has image, update it and continue */
|
/* If the icon has image, update it and continue */
|
||||||
if (icon->file_image) {
|
if (icon->file_image) {
|
||||||
icon_update_pixmap(icon, icon->file_image);
|
icon_update_pixmap(icon, icon->file_image);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_pixmap_icon_from_default_icon(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void get_pixmap_icon_from_default_icon(WIcon *icon)
|
||||||
|
{
|
||||||
|
WScreen *scr = icon->core->screen_ptr;
|
||||||
|
|
||||||
/* If the icon don't have image, we should use the default image. */
|
/* If the icon don't have image, we should use the default image. */
|
||||||
if (!scr->def_icon_rimage)
|
if (!scr->def_icon_rimage)
|
||||||
scr->def_icon_rimage = get_default_image(scr);
|
scr->def_icon_rimage = get_default_image(scr);
|
||||||
|
|||||||
Reference in New Issue
Block a user