-void draw_task_icon (Task *tsk, int text_width, int active)
-{
- if (tsk->icon_data == 0) get_icon (tsk);
- if (tsk->icon_data == 0) return;
-
- Pixmap *pmap;
-
- if (active) pmap = &tsk->area_active.pmap;
- else pmap = &tsk->area.pmap;
-
- /* Find pos */
- int pos_x;
- if (g_task.centered) {
- if (g_task.text)
- pos_x = (tsk->area.width - text_width - g_task.icon_size1) / 2;
- else
- pos_x = (tsk->area.width - g_task.icon_size1) / 2;
- }
- else pos_x = g_task.area.paddingx + g_task.area.border.width;
-
- /* Render */
- Imlib_Image icon;
- Imlib_Color_Modifier cmod;
- DATA8 red[256], green[256], blue[256], alpha[256];
-
- // TODO: cpu improvement : compute only when icon changed
- DATA32 *data;
- /* do we have 64bit? => long = 8bit */
- if (sizeof(long) != 4) {
- int length = tsk->icon_width * tsk->icon_height;
- data = malloc(sizeof(DATA32) * length);
- int i;
- for (i = 0; i < length; ++i)
- data[i] = tsk->icon_data[i];
- }
- else data = (DATA32 *) tsk->icon_data;
-
- icon = imlib_create_image_using_data (tsk->icon_width, tsk->icon_height, data);
- imlib_context_set_image (icon);
- imlib_context_set_drawable (*pmap);
-
- cmod = imlib_create_color_modifier ();
- imlib_context_set_color_modifier (cmod);
- imlib_image_set_has_alpha (1);
- imlib_get_color_modifier_tables (red, green, blue, alpha);
-
- int i, opacity;
- if (active) opacity = 255*g_task.font_active.alpha;
- else opacity = 255*g_task.font.alpha;
- for(i = 127; i < 256; i++) alpha[i] = opacity;
-
- imlib_set_color_modifier_tables (red, green, blue, alpha);
-
- //imlib_render_image_on_drawable (pos_x, pos_y);
- imlib_render_image_on_drawable_at_size (pos_x, g_task.icon_posy, g_task.icon_size1, g_task.icon_size1);
-
- imlib_free_color_modifier ();
- imlib_free_image ();
- if (sizeof(long) != 4) free(data);
+ if (panel->g_task.hue != 0 || panel->g_task.saturation != 0 || panel->g_task.brightness != 0) {
+ adjust_hsb(tsk->icon_data, tsk->icon_width, tsk->icon_height, (float)panel->g_task.hue/100, (float)panel->g_task.saturation/100, (float)panel->g_task.brightness/100);
+ }
+ if (panel->g_task.hue_active != 0 || panel->g_task.saturation_active != 0 || panel->g_task.brightness_active != 0) {
+ adjust_hsb(tsk->icon_data_active, tsk->icon_width, tsk->icon_height, (float)panel->g_task.hue_active/100, (float)panel->g_task.saturation_active/100, (float)panel->g_task.brightness_active/100);
+ }