mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-28 17:32:29 +01:00
New function update_icon_title
The function update_icon_title() updates the icon title. The code comes from the function wIconPaint().
This commit is contained in:
committed by
Carlos R. Mafra
parent
2c0a449f00
commit
ca86f5594d
15
src/icon.c
15
src/icon.c
@@ -734,14 +734,13 @@ RImage *get_rimage_icon_from_wm_hints(WIcon *icon)
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wIconPaint(WIcon *icon)
|
/* This function updates in the screen the icon title */
|
||||||
|
static void update_icon_title(WIcon *icon)
|
||||||
{
|
{
|
||||||
WScreen *scr = icon->core->screen_ptr;
|
WScreen *scr = icon->core->screen_ptr;
|
||||||
int x, l, w;
|
int x, l, w;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
XClearWindow(dpy, icon->core->window);
|
|
||||||
|
|
||||||
/* draw the icon title */
|
/* draw the icon title */
|
||||||
if (icon->show_title && icon->icon_name != NULL) {
|
if (icon->show_title && icon->icon_name != NULL) {
|
||||||
tmp = ShrinkString(scr->icon_title_font, icon->icon_name, wPreferences.icon_size - 4);
|
tmp = ShrinkString(scr->icon_title_font, icon->icon_name, wPreferences.icon_size - 4);
|
||||||
@@ -756,6 +755,16 @@ void wIconPaint(WIcon *icon)
|
|||||||
scr->icon_title_font, x, 1, tmp, l);
|
scr->icon_title_font, x, 1, tmp, l);
|
||||||
wfree(tmp);
|
wfree(tmp);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wIconPaint(WIcon *icon)
|
||||||
|
{
|
||||||
|
WScreen *scr = icon->core->screen_ptr;
|
||||||
|
|
||||||
|
XClearWindow(dpy, icon->core->window);
|
||||||
|
|
||||||
|
update_icon_title(icon);
|
||||||
|
|
||||||
if (icon->selected)
|
if (icon->selected)
|
||||||
XDrawRectangle(dpy, icon->core->window, scr->icon_select_gc, 0, 0,
|
XDrawRectangle(dpy, icon->core->window, scr->icon_select_gc, 0, 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user