mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 03:11:27 +00:00
Add icon_theme_path to find_icon() search if set
find_icon() will search in theme appropriate subdirs.
This commit is contained in:
parent
42a7860dcf
commit
0ad5e355bd
|
@ -411,9 +411,15 @@ uint32_t render_sni(cairo_t *cairo, struct swaybar_output *output, double *x,
|
||||||
char *icon_name = sni->status[0] == 'N' ?
|
char *icon_name = sni->status[0] == 'N' ?
|
||||||
sni->attention_icon_name : sni->icon_name;
|
sni->attention_icon_name : sni->icon_name;
|
||||||
if (icon_name) {
|
if (icon_name) {
|
||||||
char *icon_path = find_icon(sni->tray->themes, sni->tray->basedirs,
|
list_t *icon_search_paths = create_list();
|
||||||
|
list_cat(icon_search_paths, sni->tray->basedirs);
|
||||||
|
if (sni->icon_theme_path) {
|
||||||
|
list_add(icon_search_paths, sni->icon_theme_path);
|
||||||
|
}
|
||||||
|
char *icon_path = find_icon(sni->tray->themes, icon_search_paths,
|
||||||
icon_name, ideal_size, output->bar->config->icon_theme,
|
icon_name, ideal_size, output->bar->config->icon_theme,
|
||||||
&sni->min_size, &sni->max_size);
|
&sni->min_size, &sni->max_size);
|
||||||
|
list_free(icon_search_paths);
|
||||||
if (!icon_path && sni->icon_theme_path) {
|
if (!icon_path && sni->icon_theme_path) {
|
||||||
icon_path = find_icon_in_dir(icon_name, sni->icon_theme_path,
|
icon_path = find_icon_in_dir(icon_name, sni->icon_theme_path,
|
||||||
&sni->min_size, &sni->max_size);
|
&sni->min_size, &sni->max_size);
|
||||||
|
|
Loading…
Reference in a new issue