systray - make other apsp like teams and discord display/work

This commit is contained in:
Carsten Haitzler 2020-04-21 01:11:31 +01:00
parent 77f8008334
commit 3cc7a9d1f8
1 changed files with 30 additions and 6 deletions

View File

@ -74,24 +74,39 @@ image_load(const char *name, const char *path, uint32_t *imgdata, int w, int h,
".jpg",
NULL
};
if (path && path[0])
if (path && path[0] && name)
{
char buf[PATH_MAX];
const char **theme, *themes[] = { e_config->icon_theme, "hicolor", NULL };
const char **theme, *themes[] =
{
e_config->icon_theme,
"hicolor",
// hmm sometimes this is there
// "emblems",
NULL
};
for (theme = themes; *theme; theme++)
{
struct stat st;
unsigned int *i, sizes[] = { 16, 22, 24, 32, 36, 40, 48, 64, 72, 96, 128, 192, 256, 512, 0 };
unsigned int *i, sizes[] =
{
512, 256, 192, 128, 96, 72, 64, 48, 40, 36, 32, 24, 22, 16, 0
};
snprintf(buf, sizeof(buf), "%s/%s", path, *theme);
if (stat(buf, &st)) continue;
if (!ecore_file_is_dir(buf)) continue;
for (i = sizes; *i; i++)
{
snprintf(buf, sizeof(buf), "%s/%s/%ux%u", path, *theme, *i, *i);
if (stat(buf, &st)) continue;
if (!ecore_file_is_dir(buf)) continue;
for (ext = exts; *ext; ext++)
{
snprintf(buf, sizeof(buf), "%s/%s/%ux%u/status/%s%s", path, *theme, *i, *i, name, *ext);
if (ecore_file_exists(buf))
{
e_icon_file_set(image, buf);
return;
}
snprintf(buf, sizeof(buf), "%s/%s/%ux%u/apps/%s%s", path, *theme, *i, *i, name, *ext);
if (ecore_file_exists(buf))
{
@ -101,6 +116,15 @@ image_load(const char *name, const char *path, uint32_t *imgdata, int w, int h,
}
}
}
for (ext = exts; *ext; ext++)
{
snprintf(buf, sizeof(buf), "%s/%s%s", path, name, *ext);
if (ecore_file_exists(buf))
{
e_icon_file_set(image, buf);
return;
}
}
}
if (name && name[0] && e_util_icon_theme_set(image, name)) return;
if (imgdata)