mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 22:52:34 +01:00
Highlite current window's appicon
This patch highlites appicon of a currently focused window. Original-patch-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
This commit is contained in:
committed by
Carlos R. Mafra
parent
a257e16593
commit
392ab2607d
27
src/icon.c
27
src/icon.c
@@ -279,7 +279,7 @@ static void drawIconTitle(WScreen * scr, Pixmap pixmap, int height)
|
||||
wPreferences.icon_size - 1, 0, wPreferences.icon_size - 1, height + 1);
|
||||
}
|
||||
|
||||
static Pixmap makeIcon(WScreen * scr, RImage * icon, int titled, int shadowed, int tileType)
|
||||
static Pixmap makeIcon(WScreen *scr, RImage *icon, int titled, int shadowed, int tileType, int highlighted)
|
||||
{
|
||||
RImage *tile;
|
||||
Pixmap pixmap;
|
||||
@@ -322,6 +322,13 @@ static Pixmap makeIcon(WScreen * scr, RImage * icon, int titled, int shadowed, i
|
||||
color.alpha = 150; /* about 60% */
|
||||
RClearImage(tile, &color);
|
||||
}
|
||||
if (highlighted) {
|
||||
RColor color;
|
||||
|
||||
color.red = color.green = color.blue = 0;
|
||||
color.alpha = 160;
|
||||
RLightImage(tile, &color);
|
||||
}
|
||||
|
||||
if (!RConvertImage(scr->rcontext, tile, &pixmap)) {
|
||||
wwarning(_("error rendering image:%s"), RMessageForError(RErrorCode));
|
||||
@@ -520,6 +527,18 @@ static void cycleColor(void *data)
|
||||
icon->handlerID = WMAddTimerHandler(COLOR_CYCLE_DELAY, cycleColor, icon);
|
||||
}
|
||||
|
||||
#ifdef NEWAPPICON
|
||||
void wIconSetHighlited(WIcon *icon, Bool flag)
|
||||
{
|
||||
if (icon->highlighted == flag)
|
||||
return;
|
||||
|
||||
icon->highlighted = flag;
|
||||
icon->force_paint = True;
|
||||
wIconPaint(icon);
|
||||
}
|
||||
#endif
|
||||
|
||||
void wIconSelect(WIcon * icon)
|
||||
{
|
||||
WScreen *scr = icon->core->screen_ptr;
|
||||
@@ -669,7 +688,7 @@ void wIconUpdate(WIcon * icon)
|
||||
|
||||
if (icon->image) {
|
||||
icon->pixmap = makeIcon(scr, icon->image, icon->show_title,
|
||||
icon->shadowed, icon->tile_type);
|
||||
icon->shadowed, icon->tile_type, icon->highlighted);
|
||||
} else {
|
||||
/* make default icons */
|
||||
|
||||
@@ -696,8 +715,8 @@ void wIconUpdate(WIcon * icon)
|
||||
make_icons:
|
||||
|
||||
image = wIconValidateIconSize(scr, image);
|
||||
scr->def_icon_pixmap = makeIcon(scr, image, False, False, icon->tile_type);
|
||||
scr->def_ticon_pixmap = makeIcon(scr, image, True, False, icon->tile_type);
|
||||
scr->def_icon_pixmap = makeIcon(scr, image, False, False, icon->tile_type, icon->highlighted);
|
||||
scr->def_ticon_pixmap = makeIcon(scr, image, True, False, icon->tile_type, icon->highlighted);
|
||||
if (image)
|
||||
RReleaseImage(image);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user