Added alpha, saturation, brightness control for launcher icons (Issue 365).
git-svn-id: http://tint2.googlecode.com/svn/trunk@641 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
9c90f80ff1
commit
6542370297
3 changed files with 20 additions and 0 deletions
|
@ -588,6 +588,12 @@ void add_entry (char *key, char *value)
|
||||||
if (!icon_theme_name)
|
if (!icon_theme_name)
|
||||||
icon_theme_name = strdup(value);
|
icon_theme_name = strdup(value);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(key, "launcher_icon_asb") == 0) {
|
||||||
|
extract_values(value, &value1, &value2, &value3);
|
||||||
|
launcher_alpha = atoi(value1);
|
||||||
|
launcher_saturation = atoi(value2);
|
||||||
|
launcher_brightness = atoi(value3);
|
||||||
|
}
|
||||||
|
|
||||||
/* Tooltip */
|
/* Tooltip */
|
||||||
else if (strcmp (key, "tooltip_show_timeout") == 0) {
|
else if (strcmp (key, "tooltip_show_timeout") == 0) {
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
|
|
||||||
int launcher_enabled;
|
int launcher_enabled;
|
||||||
int launcher_max_icon_size;
|
int launcher_max_icon_size;
|
||||||
|
int launcher_alpha;
|
||||||
|
int launcher_saturation;
|
||||||
|
int launcher_brightness;
|
||||||
char *icon_theme_name;
|
char *icon_theme_name;
|
||||||
XSettingsClient *xsettings_client;
|
XSettingsClient *xsettings_client;
|
||||||
|
|
||||||
|
@ -52,6 +55,9 @@ void default_launcher()
|
||||||
{
|
{
|
||||||
launcher_enabled = 0;
|
launcher_enabled = 0;
|
||||||
launcher_max_icon_size = 0;
|
launcher_max_icon_size = 0;
|
||||||
|
launcher_alpha = 100;
|
||||||
|
launcher_saturation = 0;
|
||||||
|
launcher_brightness = 0;
|
||||||
icon_theme_name = 0;
|
icon_theme_name = 0;
|
||||||
xsettings_client = NULL;
|
xsettings_client = NULL;
|
||||||
}
|
}
|
||||||
|
@ -301,6 +307,11 @@ Imlib_Image scale_icon(Imlib_Image original, int icon_size)
|
||||||
if (original) {
|
if (original) {
|
||||||
imlib_context_set_image (original);
|
imlib_context_set_image (original);
|
||||||
icon_scaled = imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), icon_size, icon_size);
|
icon_scaled = imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), icon_size, icon_size);
|
||||||
|
imlib_context_set_image (icon_scaled);
|
||||||
|
imlib_image_set_has_alpha(1);
|
||||||
|
DATA32* data = imlib_image_get_data();
|
||||||
|
adjust_asb(data, icon_size, icon_size, launcher_alpha, (float)launcher_saturation/100, (float)launcher_brightness/100);
|
||||||
|
imlib_image_put_back_data(data);
|
||||||
} else {
|
} else {
|
||||||
icon_scaled = imlib_create_image(icon_size, icon_size);
|
icon_scaled = imlib_create_image(icon_size, icon_size);
|
||||||
imlib_context_set_image (icon_scaled);
|
imlib_context_set_image (icon_scaled);
|
||||||
|
|
|
@ -60,6 +60,9 @@ typedef struct IconTheme {
|
||||||
|
|
||||||
extern int launcher_enabled;
|
extern int launcher_enabled;
|
||||||
extern int launcher_max_icon_size;
|
extern int launcher_max_icon_size;
|
||||||
|
extern int launcher_alpha;
|
||||||
|
extern int launcher_saturation;
|
||||||
|
extern int launcher_brightness;
|
||||||
extern char *icon_theme_name; // theme name
|
extern char *icon_theme_name; // theme name
|
||||||
extern XSettingsClient *xsettings_client;
|
extern XSettingsClient *xsettings_client;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue